Add Google as SSO Provider¶
To integrate Google as a new SSO provider, install the Google SSO module. After that:
Create Google OAuth 2.0 Client¶
To integrate Google APIs with your application using OAuth 2.0, you need to create authorization credentials. These credentials will allow your app to access the enabled APIs for your project:
- Go to the Google API & Services Console.
- Create a new project if you don't have one, then open the project dashboard.
- Configure OAuth consent screen. In the OAuth consent screen tab:
- Select User Type → External and click Create.
- Fill in the App Information (name, user support email, and developer contact information).
- Skip the Scopes and Test users sections for now.
- Review your settings and return to the dashboard.
- Navigate to the Credentials tab, select Create credentials → OAuth client ID.
- Choose Web application as the Application type and name your credentials.
-
In the Authorized redirect URIs section, click ADD URI to specify the redirect URI. Ensure your platform uses HTTPS; otherwise, SSO will not function correctly.
Note
If your platform runs on a local machine, put https://localhost:10645/signin-google.
-
Click Create.
- Save Client ID and Client Secret to use them in the module.
Set appsettings.json file¶
Store Google Client ID, secret values and other sensitive settings in KeyVault Storage. In our example, we use the appsettings.json configuration file. Add the following section to the configuration:
"Google": {
"Enabled": true,
"AuthenticationType": "Google",
"AuthenticationCaption": "Google",
"ClientId": "<your Client ID>",
"ClientSecret": "<your Client Secret>",
"DefaultUserType": "Manager"
},
Manage Platform settings¶
Configure store settings:
- Click Stores in the main menu.
- In the next blade, select the desired store.
- In the next blade, click on the Authentication widget.
-
In the next blade, enable/disable Google sign-in for the selected store.
Note
By default, all registered authentication types are enabled.
-
Click Save to save the changes.
The GraphQL query confirms that authentication via Google AD is enabled:
The Google authentication button appears on the login page of the Frontend Application: