# Single sign-on with Microsoft Entra ID

> Connect Microsoft Entra ID (Azure AD) to MoreVoice with SAML 2.0 or OpenID Connect, map its groups to roles and teams, and provision members with SCIM.

You need: the Owner role in MoreVoice, and an Entra ID role that can create enterprise applications (Application
Administrator or Cloud Application Administrator). Automatic provisioning needs Entra ID P1 or P2. Start with
[verifying your domain](https://docs.morevoice.ai/enterprise/sso/#verify-your-domain).

## 1. Start the connection in MoreVoice

1. **Security › Single sign-on › Set up single sign-on**.
2. Choose **Microsoft Entra ID**, keep **SAML 2.0**, name the connection and select **Continue**.
3. Keep the next step (the values to paste) open.

## 2. Create the enterprise application in Entra ID

1. In the Microsoft Entra admin center, go to **Identity → Applications → Enterprise applications → New application →
   Create your own application**, name it (for example *MoreVoice*) and choose **Integrate any other application you
   don't find in the gallery (Non-gallery)**.
2. **Single sign-on → SAML → Basic SAML Configuration → Edit:**

   | Entra ID field | MoreVoice value |
   |---|---|
   | Identifier (Entity ID) | **Entity ID** (`https://YOUR-HOST/saml/<connection id>`), and tick *Default* |
   | Reply URL (Assertion Consumer Service URL) | **ACS URL** (`https://YOUR-HOST/api/auth/saml/<connection id>/acs`) |
   | Sign on URL | optional: `https://YOUR-HOST/login` |

3. **Attributes & Claims:** the defaults work — MoreVoice's Entra preset reads the standard claims
   (`…/claims/emailaddress`, `…/givenname`, `…/surname`) and uses the immutable **object ID**
   (`http://schemas.microsoft.com/identity/claims/objectidentifier`) to recognise people. Make sure the *Unique User
   Identifier (Name ID)* is the person's email (`user.mail` or a UPN that is their email).
   For group mapping: **Add a group claim → Groups assigned to the application** (recommended; it avoids Entra's limit
   of 150 groups per token) → source attribute **Group ID**.
4. **SAML Certificates:** keep *Signing Option* = **Sign SAML assertion** (or *Sign SAML response and assertion*) and
   *Signing Algorithm* = **SHA-256**. Copy the **App Federation Metadata Url** (or download *Federation Metadata XML*).
5. **Users and groups:** assign the people or groups who should use MoreVoice.

## 3. Finish the connection in MoreVoice

1. **Connection** step: *Import the identity provider's metadata* → **Metadata URL** → paste the App Federation
   Metadata URL → **Import** (or upload the XML). Check the values and the certificate expiry, then **Save and continue**.
2. **People** step: keep the attribute names of the preset. Group mappings for Entra ID use the group's **object ID**
   (a GUID), not its display name. Choose just-in-time sign-up, or leave it off and use SCIM.
3. **Test and activate:** **Test connection**, sign in with an assigned user, read the report, **Activate**.

**Sign-in from My Apps (IdP-initiated):** off by default. Turn on *Allow sign-in from the provider's portal* under the
connection's advanced settings, or set the Sign on URL above so the tile opens MoreVoice's sign-in page.

## OpenID Connect instead of SAML

1. In MoreVoice choose **Microsoft Entra ID** with **OpenID Connect**; copy the **Redirect URI**.
2. In Entra: **App registrations → New registration**, *Accounts in this organisational directory only*, Redirect URI
   platform **Web** = the MoreVoice redirect URI.
3. **Certificates & secrets → New client secret**; copy its **Value** (not the ID). Note its expiry.
4. **Token configuration:** **Add optional claim → ID → `email`**; for groups, **Add groups claim → Security groups**
   (ID token: *Group ID*).
5. In MoreVoice, **Connection** step: *Issuer URL* = `https://login.microsoftonline.com/<Directory (tenant) ID>/v2.0`,
   *Client ID* = the Application (client) ID, *Client secret* = the secret's value. Under *Advanced*, turn on **Trust the
   email without email_verified** (Entra ID doesn't send `email_verified`; an explicit `false` is still refused).
6. Test and activate.

## User provisioning with SCIM

1. In MoreVoice, **User provisioning (SCIM)**: copy the **SCIM base URL** and create a **New token** (shown once).
2. In the enterprise application: **Provisioning → Get started**, Provisioning Mode **Automatic**.
3. **Admin Credentials:**
   - Tenant URL: the SCIM base URL followed by `?aadOptscim062020`
     (`https://YOUR-HOST/scim/v2?aadOptscim062020`). The flag makes Entra ID follow the SCIM 2.0 PATCH rules.
   - Secret Token: the MoreVoice token. Select **Test Connection**.
4. **Mappings → Provision Microsoft Entra ID Users:** check that `userName` comes from the person's email
   (`userPrincipalName` when the UPN is the email, else `mail`), `active` from `Switch([IsSoftDeleted], …)` (the default),
   `name.givenName` / `name.familyName` from `givenName` / `surname`, and `emails[type eq "work"].value` from `mail`.
   Remove mappings MoreVoice doesn't use if you like (phone numbers, addresses).
5. **Mappings → Provision Microsoft Entra ID Groups:** keep it enabled to push groups.
6. **Settings:** Scope **Sync only assigned users and groups**. Turn **Provisioning Status** on and **Save**.
7. Entra ID provisions every 40 minutes; **Provision on demand** tests one user at once.
8. In MoreVoice, **Group mapping → SCIM groups**: map the provisioned groups to roles and teams.

Disabling or unassigning a user in Entra ID suspends their membership in MoreVoice and signs them out; the last owner
is never suspended by SCIM.

## Recommended next steps

- [Require single sign-on](https://docs.morevoice.ai/enterprise/sso/#require-single-sign-on).
- Certificate rollover: in **SAML Certificates**, create a new certificate, add it to the MoreVoice connection next to
  the current one, then make it active in Entra ID ([details](https://docs.morevoice.ai/enterprise/sso/#certificate-rollover)).
- OIDC client secrets expire (6–24 months): create the new secret, update the connection, test, activate.
- Problems? See [troubleshooting](https://docs.morevoice.ai/enterprise/sso-troubleshooting/).
