# Single sign-on with Google Workspace

> Connect Google Workspace to MoreVoice with a custom SAML app, create members at their first sign-in, and map Google groups to roles and teams.

You need: the Owner role in MoreVoice, and a Google Workspace super admin. Start with
[verifying your domain](https://docs.morevoice.ai/enterprise/sso/#verify-your-domain) — just-in-time sign-up only creates people from verified domains.

Google Workspace can't provision custom apps with SCIM. People are created the first time they sign in
(just-in-time), with the role and team their groups map to; when someone leaves, suspend or remove them in
**Users & Teams** (signing in through Google stops working as soon as their Google account is suspended).

## 1. Start the connection in MoreVoice

1. **Security › Single sign-on › Set up single sign-on**.
2. Choose **Google Workspace** (SAML 2.0), name the connection and select **Continue**. Keep the values step open.

## 2. Create the custom SAML app in Google

1. In the Google Admin console: **Apps → Web and mobile apps → Add app → Add custom SAML app**. Name it (for example
   *MoreVoice*) and select **Continue**.
2. **Google Identity Provider details:** select **Download metadata** (or copy the *SSO URL*, *Entity ID* and
   *Certificate*). Select **Continue**.
3. **Service provider details:**

   | Google field | MoreVoice value |
   |---|---|
   | ACS URL | **ACS URL** (`https://YOUR-HOST/api/auth/saml/<connection id>/acs`) |
   | Entity ID | **Entity ID** (`https://YOUR-HOST/saml/<connection id>`) |
   | Start URL | leave empty |
   | Signed response | leave off (Google signs the assertion, which is what MoreVoice requires) |
   | Name ID format | `EMAIL` |
   | Name ID | **Basic Information › Primary email** |

4. **Attribute mapping:**

   | Google Directory attribute | App attribute |
   |---|---|
   | Primary email | `email` |
   | First name | `firstName` |
   | Last name | `lastName` |

   For group mapping, under **Group membership (optional)** pick the Google groups to send, with app attribute `groups`.
   Google sends only the selected groups that the person belongs to.
5. **Finish**, then open the app → **User access** → **ON for everyone** (or for the organisational units / groups who
   should use MoreVoice) → **Save**. It can take a few minutes (up to 24 hours) to apply.

## 3. Finish the connection in MoreVoice

1. **Connection** step: *Import the identity provider's metadata* → **Upload file** → the metadata you downloaded.
   Check the values and the certificate expiry (Google certificates last five years), then **Save and continue**.
2. **People** step: turn on **Create accounts at first sign-in**, and choose the default role and team.
3. **Test and activate:** **Test connection**, sign in with a Google account that has access to the app, read the
   report, **Activate**.
4. **Group mapping → Sign-in group claims → Add mapping:** enter each group value **exactly as the test report's
   *Groups* line shows it** (the report shows group values unmasked so you can copy them). Turn on **Apply group
   mappings at every sign-in** on the connection if roles should follow group changes at each sign-in.

**Sign-in from the Google app launcher (IdP-initiated):** off by default, so people start at MoreVoice's sign-in page
(*Continue with single sign-on*). If they should also start from the app launcher, turn on *Allow sign-in from the
provider's portal* in the connection's advanced settings (test and activate again).

## Recommended next steps

- [Require single sign-on](https://docs.morevoice.ai/enterprise/sso/#require-single-sign-on).
- Certificate rollover: in the app's **Service provider details**, Google can add a second certificate; add it to the
  MoreVoice connection next to the current one before switching ([details](https://docs.morevoice.ai/enterprise/sso/#certificate-rollover)).
- Problems? See [troubleshooting](https://docs.morevoice.ai/enterprise/sso-troubleshooting/).
