# Google Workspace

> Create a custom SAML application for your Workspace users.

Source: https://diakrin.com/docs/sso/google-workspace

A Google Workspace administrator connects Workspace to Diakrin with a custom SAML app. This is separate from the consumer **Continue with Google** button. You need permission to manage SAML apps in Google Admin console and the [setup packet](/docs/sso#get-your-setup-packet).

## Create the application

1. Open **Apps → Web and mobile apps → Add app → Add custom SAML app**.
2. Name the app **Diakrin**. Download the Google identity-provider metadata XML.
3. In **Service provider details**, enter the values below. Set **Name ID format** to **PERSISTENT**.
4. Set **Name ID** to a user field that never changes and is never reassigned, such as an employee id. Add an attribute mapping named `email` from **Basic Information → Primary email**.
5. Turn the app on for your pilot organizational unit or group only.

## Map the fields

| Google Workspace field | Value |
| --- | --- |
| ACS URL | `https://auth.diakrin.com/saml2/idpresponse` |
| Entity ID | `urn:amazon:cognito:sp:<poolId>` from the setup packet |
| Name ID format | PERSISTENT |
| Name ID | A never-reassigned id field, not the primary email |
| App attribute `email` | Primary email |

The Name ID is Persistent and identifies the person for good. Do not use the primary email as the Name ID: an address can pass to a new employee, who would then sign in as the person who had it before. If your directory has no field like this, tell your onboarding contact before you continue.

## Activate and test

In **Settings → Sign-in → SSO identity provider**, paste the metadata URL or upload the XML, then select **Verify and connect**. After activation, start from the console's company SSO form and follow [Test and roll out SSO](/docs/sso/testing). Google app-access changes can take time to apply; wait before retesting.

## If it fails

| Symptom | Cause | Fix |
| --- | --- | --- |
| Google says the app is not enabled | The person's organizational unit or group is not turned on | Turn the app on for them |
| Google succeeds but Diakrin refuses | The person is not a member of your organization yet | See [Sign in and join your team](/docs/sso#sign-in-and-join-your-team) |

Official reference: [Set up your own custom SAML app](https://knowledge.workspace.google.com/admin/apps/set-up-your-own-custom-saml-app).
