Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Google SSO Integration

This page teaches you how to integrate Google Workspace (SAML 2.0) into your Amazon Cognito User Pool.

Google Workspace SSO Integration

Follow the information and steps below to let your Google Workspace users sign in to the CSS Console with SSO.

You will need Super Admin access to the Google Admin console (admin.google.com) and access to the Amazon Cognito User Pool created by your CSS application.

Set up Cognito

  1. Capture the Cognito User Pool ID

In the AWS Console, navigate to the User Pool created by your application. It'll generally look like "CloudStorageSecUserPool-{appid}".

Copy the User Pool ID.

  1. Create a Cognito Domain

In the User Pool, navigate to Domain and select 'Create Cognito Domain'.

Create the domain of your choice and copy the full domain (it should end in ...auth.{region}.amazoncognito.com).

Google: Create a custom SAML app

  1. Add a new app

In the Google Admin console, navigate to Apps > Web and mobile apps. Select 'Add app' and then 'Add custom SAML app'.

  1. Enter the app details

Enter an app name of your choice (for example, "CloudStorageSec Console"). Upload an app icon if you would like. Select 'Continue'.

  1. Download the Google IdP metadata

On the 'Google Identity Provider details' page, select 'Download metadata' to download the GoogleIDPMetadata.xml file. You will upload this file to Cognito later. Select 'Continue'.

  1. Enter the service provider details

Here's a chart for the items that must be entered in. After these values, select 'Continue'.

Key
Value
Example

ACS URL

enter 'https://{cognito_domain_prefix}.auth.{your_region}.amazoncognito.com/saml2/idpresponse'. Refer back to the domain created in the 'Create a Cognito Domain' step.

https://css-demo.auth.us-west-2.amazoncognito.com/saml2/idpresponse

Entity ID

enter 'urn:amazon:cognito:sp:{userpoolid}'

urn:amazon:cognito:sp:us-west-2_abcd123

Name ID format

EMAIL

EMAIL

Name ID

Basic Information > Primary email

Basic Information > Primary email

Leave 'Start URL' empty and leave 'Signed response' unchecked.

  1. Add the attribute mapping

On the 'Attribute mapping' page, select 'Add mapping' and enter the following:

Google Directory attributes
App attributes

Primary email

http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress

Select 'Finish'.

Google: Turn on the app for your users

New custom SAML apps are turned OFF for everyone by default. Users will not be able to sign in until the app is turned on for them.

  1. In Apps > Web and mobile apps, select the app you just created.

  2. Select the 'User access' panel.

  3. Select 'ON for everyone', or select the organizational unit or group that should have access and set the service status to 'ON'.

  4. Select 'Save'.

Changes to user access can take a few minutes (and up to 24 hours) to take effect in Google Workspace.

AWS: Add Google as an Identity Provider

In the AWS Console:

  1. Navigate back to your Cognito User Pool and select 'Social and external providers'.

  2. Select 'Add identity provider' and select 'SAML'.

  1. Enter a provider name, for example GoogleWorkspace. Do not add spaces. This name is shown on the CSS Console sign-in button.

  1. Under 'Metadata document source', select 'Upload metadata document' and upload the GoogleIDPMetadata.xml file you downloaded from Google.

  2. Under 'Map attributes between your SAML provider and your user pool', add the following:

    • User pool attribute: email

    • SAML attribute: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress

  3. Select 'Add identity provider'.

AWS: Configure the Cognito App Client

In Cognito, navigate to App Clients -> {your app client} and select 'Login pages'.

Select the 'Edit' button and enter in the following:

  • Allowed callback URLs: CSS Console URL

  • Allowed sign-out URLs: CSS Console URL

  • Identity Providers: the Google identity provider you just created and 'Cognito user pool'

  • OAuth 2.0 grant types: 'Authorization code grant', 'Implicit grant'

  • OpenID Connect scopes: 'OpenID', 'Email', 'Profile'

Select 'Save changes'.

The callback URL must match the CSS Console URL exactly (for example, https://{subdomain}.cloudstoragesecapp.com), with no trailing path.

CSS Console: Verify Changes

In the CSS Console:

View the sign-in page and note that a 'Sign In With GoogleWorkspace' button (or the provider name you chose) now appears.

CSS Console: Set SSO Defaults (Optional)

New users who sign in with SSO for the first time are automatically assigned a default role and group.

  1. Log in as a user that has Admin permissions.

  2. Go to Configuration -> Console Settings and scroll to 'SSO Defaults'.

  3. Select the 'Default Role' and 'Default Group' for new SSO users and select 'Save'.

CSS Console: Set Up User

  1. Click on the 'Sign In With GoogleWorkspace' button and sign in with your Google account. This will create the user in Cognito.

  2. Log in as a user that has Admin permissions.

  3. Go to Access Management -> Manage Users. There will be a new user created with the format {provider_name}_{google_user_email} in the Manage Users page.

  4. (Optional) Click the 3 buttons next to the Status and choose 'Change Groups' to assign the user to a different group.

  5. If the user is disabled, enable the user by clicking the button with 3 dots on the rightmost column and selecting 'Enable User'.

  6. (Optional) Click the 3 buttons next to the Status and choose 'Change Role'. The user gets the default role from 'SSO Defaults' and can be adjusted to another role if needed.

Your user is now set up! Log out and click the SSO button. You are now logged in as the SSO user!

Troubleshooting

Error
Cause and fix

Google shows 'app_not_configured_for_user'

The app is not turned ON for this user. Review the 'Google: Turn on the app for your users' step, and allow time for the change to take effect.

Google shows 'Invalid ACS URL' or 'Invalid Entity ID'

The ACS URL or Entity ID in Google does not match Cognito. Confirm the Cognito domain and User Pool ID were entered exactly.

Cognito shows 'redirect_mismatch' after signing in

The Allowed callback URL in the Cognito App Client does not exactly match the CSS Console URL.

The user is created without an email

The 'Primary email' attribute mapping is missing in Google, or the email attribute mapping is missing in Cognito.

Last updated