Create a Developer Project
Configure the OAuth consent screen
- On the left hand side, click APIs & auth to expand the menu, then click Credentials
- At the top of the screen, click OAuth consent screen
- Enter your product/project name in the Product name field
- This is the only required field; You may fill in option information, if you wish
- Click Save
Configure an application with Google
- On the left hand side, click APIs & auth to expand the menu, then click Credentials
- Click the Add credentials drop down, and select OAuth 2.0 client ID
- Select Web application
- Give your web application a name. (ex: use your DNN portal's name. Users will see this name when logging in with Google for the first time)
- Provide the Authorized JavaScript Origins (this is your domain name, such as http://mydomain.com or https://mydomain.com)
- Provide the Authorized redirect URIs (This is your login page, such as http://mydomain.com/Login or http://mydomain.com/Login.aspx)
- Click Create
- Google will now provide you with a client ID and your client secret. Copy these down, as we will need them in the next part.
Configure Google Authentication in DNN
- Log into your DNN installation as a SuperUser
- If the provider is not installed, go to Host > Extensions and click the Available Extensions tab
- Expand Authentication Systems
- Click Install for DotNetNuke Google Authentication Project
- Go through the prompts to install the provider
- Go to Admin > Extensions
- Scroll all the way down and expand Authentication systems
- Click the 'Pencil'/edit symbol for DotNetNuke Google Authentication Project
- For APP ID, input your client ID
- For APP Secret, input your client secret
- Check Enabled and click Update Authentication Settings
- Log out of your site, and log in using Google to verify it works correctly
Common Errors
- redirect_uri_mismatch
- Be sure that the URL of your log in page is added to the authorized redirect URIs in the developers console.
- Both versions of your site, non-WWW and WWW, may need to be added as authorized redirect URIs.
- invalid_client
- Be sure that you copied your client ID down properly, and that you didn't copy and paste any leading or trailing spaces into the APP ID field.
- This error may also be caused by creating OAuth2 tokens prior to configuring the OAuth consent screen
- In such a case, you need to configure the OAuth consent screen and recreate the OAuth2 tokens, then follow the instructions to put the new tokens into DNN
Article ID: 2278, Created: September 6, 2015 at 9:46 AM, Modified: September 6, 2015 at 4:38 PM