How to Configure Google Authentication Provider in DNN

DNN > How To

Create a Developer Project

  1. In your browser, go to https://console.developers.google.com
  2. Near the top, click Select a project and click Create a project
  3. Enter your Project name, and click Create

Configure the OAuth consent screen

  1. On the left hand side, click APIs & auth to expand the menu, then click Credentials
  2. At the top of the screen, click OAuth consent screen
  3. 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
  4. Click Save

Configure an application with Google

  1. On the left hand side, click APIs & auth to expand the menu, then click Credentials
  2. Click the Add credentials drop down, and select OAuth 2.0 client ID
  3. Select Web application
  4. 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)
  5. Provide the Authorized JavaScript Origins (this is your domain name, such as http://mydomain.com or https://mydomain.com) 
  6. Provide the Authorized redirect URIs (This is your login page, such as http://mydomain.com/Login or http://mydomain.com/Login.aspx)
  7. Click Create
  8. 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

  1. Log into your DNN installation as a SuperUser
  2. If the provider is not installed, go to Host > Extensions and click the Available Extensions tab
    1. Expand Authentication Systems
    2. Click Install for DotNetNuke Google Authentication Project
    3. Go through the prompts to install the provider
  3. Go to Admin > Extensions
  4. Scroll all the way down and expand Authentication systems
  5. Click the 'Pencil'/edit symbol for DotNetNuke Google Authentication Project
  6. For APP ID, input your client ID
  7. For APP Secret, input your client secret
  8. Check Enabled and click Update Authentication Settings
  9. 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

Add Feedback