Add Google Workspace as a SAML connection
Before you start
Clerk supports Enterprise SSO via the SAML protocol, enabling you to create authentication strategies for an Identity Provider (IdP).
When you configure a SAML connection with Google Workspace as your IdP, your users can sign up and sign in to your application with their Google account. In this guide, you configure the connection in the Clerk Dashboard, while the customer (whoever manages the Google Admin Console) configures it on the Google side.
Create a Google Workspace SAML connection in Clerk
- In the Clerk Dashboard, navigate to the SSO connections page.
- Select Add connection and select For specific domains or organizations.
- Under SAML, select Google Workspace.
- Enter the Domain. This is the email domain of the users you want to allow to sign in to your application. Optionally, select an Organization.
- Enter the Name. This will be displayed on the sign-in form.
- Select Add connection. You'll be redirected to the connection's configuration page.
- In the Service Provider Configuration section, save the ACS URL and Entity ID values somewhere secure. You'll need to give these to the customer so they can configure their Google Workspace application.
Configure SAML application
Now the customer's Google Workspace application needs to be configured with the ACS URL and Entity ID from Clerk.
To get you started, you can use the following email template with detailed instructions. Remember to share the ACS URL and Entity ID:
Add the IdP configuration in Clerk
Once the customer has shared their Google Workspace details, add them to the connection. There are two options:
- Metadata configuration (recommended) - Use the metadata file the customer downloaded from Google. This is quicker than manually inputting the configuration settings.
- Custom configuration - Manually input the configuration settings.
Metadata configuration
- In the Clerk Dashboard, open the connection and, in the Identity Provider Configuration section, select Upload file.
- Upload the metadata file that the customer shared.
Custom configuration
If you're configuring the connection manually, fill in these three fields in the Clerk Dashboard:
- SSO URL - Your IdP's URL that Clerk will redirect your users to so that they can authenticate.
- Entity ID - The unique identifier of your IdP application.
- Certificate - The certificate needed for Clerk to securely connect to your IdP.
- In the Identity Provider Configuration section, select Use manual configuration.
- Fill in the SSO URL and Entity ID, and upload the Certificate that the customer shared. Select Save.
Map IdP claims to Clerk fields
Clerk automatically maps the standard SAML claims (email, first name, and last name) to the User object. To review them, open the connection's SSO tab and find the Common attributes section under Attribute mapping.
To map a claim that has no standard Clerk field, store it in the user's publicMetadata. The approach depends on whether the connection also uses Directory Sync:
- SSO only: In the IdP, prefix the claim name with
public_metadata_. For example, mapping a phone number topublic_metadata_phone_numberstores it underphone_numberinUser.publicMetadata. Some IdPs, such as Microsoft Entra, send claims as URLs; map those as plain strings. - SSO with Directory Sync: Define a custom attribute so the mapping applies to both SSO and SCIM. Define it on the connection's Overview tab (in the Identity provider attributes section), then map it in the SSO tab (in the Custom attributes section of the Attribute mapping section). Refer to the guide on custom attribute mapping. While Directory Sync is enabled, SCIM is the only source for these values and overrides SSO.
Learn more about accessing user metadata from the API.
Enable the connection in Clerk
You have configured the SAML connection. Once enabled, all users with email addresses ending in the domain will be redirected to your identity provider at sign-up and sign-in.
To make the connection available for your users to authenticate with:
- Navigate to the SSO connections page and select the connection.
- At the top of the page, toggle on Enable connection and select Save.
Feedback
Last updated on