Set up the Google provider

Google is one of the OAuth 2.0 identity providers you can use to authenticate visitors to your Power Pages site. OAuth 2.0–based identity providers require a client ID, client secret, and sometimes a redirect or reply URL. This article describes the following steps:

Set up Google in Power Pages

  1. In your Power Pages site, select Set up > Identity providers.

    If no identity providers appear, make sure External login is set to On in your site's general authentication settings.

  2. To the right of Google, select More Commands () > Configure or select the provider name.

  3. Leave the provider name as it is or change it if you like.

    The provider name is the text on the button that users see when they select their identity provider on the sign-in page.

  4. Select Next.

  5. Under Reply URL, select Copy.

  6. Select Open Google.

    Don't close your Power Pages browser tab. You'll return to it soon.

Create an app registration in Google

Register an application in Google with your site's reply URL as the redirect URL.

Note

If you use or add a custom domain name or change your site's base URL, you must set up your identity provider to use the correct reply URL. The Google app uses the reply URL to redirect users to your website after authentication.

Add the API

  1. Open the Google Developers Console.

  2. Create or open an API project.

  3. In the left side panel, select APIs & Services.

  4. Select + Enable APIs and Services.

  5. Search for and enable Google People API.

    Important

    Google+ API is deprecated. We strongly recommend that you migrate to Google People API.

If you already have a consent screen for your website's top-level domain, skip to Add credentials. If your site has a consent screen but you haven't added the top-level domain, skip to Enter your top-level domain.

  1. In the left side panel, select Credentials.

  2. Select Configure consent screen.

  3. Select the External user type.

  4. Select Create.

  5. Enter the name of the application and select your organization's user support email address.

  6. Upload a logo image file if necessary.

  7. Enter the URLs of your site's home page, privacy policy, and terms of service, if applicable.

  8. Enter an email address where Google can send you developer notifications.

Enter your top-level domain

  1. Under Authorized domains, select + Add Domain.

  2. Enter your site's top-level domain; for example, powerappsportals.com.

    Tip

    Use microsoftcrmportals.com if you haven't updated your domain name. If your site uses a custom domain name, enter it instead.

  3. Select Save and Continue.

Add credentials

  1. In the left side panel, select Credentials.

  2. Select Create credentials > OAuth client ID.

  3. Select Web application as the application type.

  4. Enter a name to identify your OAuth Client; for example, Web sign-in.

    This name is for internal use only and isn't shown to users.

  5. Under Authorized JavaScript origins, select + Add URI.

  6. Enter your site's URL; for example, https://contoso.powerappsportals.com.

  7. Under Authorized redirect URIs, select + Add URI.

  8. Enter your site's URL followed by /signin-google; for example, https://contoso.powerappsportals.com/signin-google.

  9. Select Create.

  10. In the OAuth client created window, select the copy icons to copy the Client ID and Client secret.

  11. Select OK.

Enter site settings in Power Pages

  1. Return to the Power Pages Configure identity provider page you left earlier.

  2. Under Configure site settings, paste the following values:

    • Client ID​: Paste the Client ID you copied.
    • Client secret: Paste the Client secret you copied.

Optional additional settings for OAuth 2.0 identity providers

See also

Set up site authentication