# Single sign-on with Okta

> Connect Okta to MoreVoice with SAML 2.0 or OpenID Connect, map Okta groups to roles and teams, and provision members with SCIM.

You need: the Owner role in MoreVoice, and an Okta admin who can create app integrations. Start with
[verifying your domain](https://docs.morevoice.ai/enterprise/sso/#verify-your-domain).

## 1. Start the connection in MoreVoice

1. Go to **Security › Single sign-on** and select **Set up single sign-on**.
2. Choose **Okta**, keep **SAML 2.0**, give the connection a name (for example *Okta (production)*) and select **Continue**.
3. The next step shows the values to paste into Okta. Keep this window open.

## 2. Create the SAML app in Okta

1. In the Okta Admin Console, go to **Applications → Applications → Create App Integration**, choose **SAML 2.0** and
   select **Next**.
2. **General Settings:** name the app (for example *MoreVoice*), optionally upload a logo, select **Next**.
3. **Configure SAML** — paste the values from MoreVoice:

   | Okta field | MoreVoice value |
   |---|---|
   | Single sign-on URL | **ACS URL** (`https://YOUR-HOST/api/auth/saml/<connection id>/acs`). Keep *Use this for Recipient URL and Destination URL* checked. |
   | Audience URI (SP Entity ID) | **Entity ID** (`https://YOUR-HOST/saml/<connection id>`) |
   | Name ID format | `EmailAddress` |
   | Application username | `Email` |
   | Response | `Signed` is fine; the assertion must be signed (Okta's default *Assertion Signature: Signed*) |
   | Signature / digest algorithm | `RSA-SHA256` / `SHA256` |

4. **Attribute Statements:**

   | Name | Name format | Value |
   |---|---|---|
   | `email` | Unspecified | `user.email` |
   | `firstName` | Unspecified | `user.firstName` |
   | `lastName` | Unspecified | `user.lastName` |

   **Group Attribute Statements** (for group mapping): name `groups`, format *Unspecified*, filter **Matches regex**
   `.*` — or narrow it, for example **Starts with** `mv-`.
5. Finish (*I'm an Okta customer adding an internal app*).
6. **Assignments:** assign the people or groups who should use MoreVoice.
7. **Sign On** tab: copy the **Metadata URL** (or select *View SAML setup instructions* / download the metadata XML).

## 3. Finish the connection in MoreVoice

1. **Connection** step: under *Import the identity provider's metadata* choose **Metadata URL**, paste Okta's metadata
   URL and select **Import** (or upload the XML file). Check the imported *sign-in URL*, *entity ID* and *signing
   certificate* (its fingerprint and expiry are shown), then **Save and continue**.
2. **People** step: the attribute names already match the statements above. Choose whether to **create accounts at
   first sign-in** (just-in-time sign-up, for people from your verified domains) and their default role and team.
   With SCIM (below) leave just-in-time sign-up off: Okta then decides who has access.
3. **Test and activate:** select **Test connection**, sign in with an assigned Okta user, read the report, then
   **Activate**. See [testing and activating](https://docs.morevoice.ai/enterprise/sso/#test-and-activate).

**Sign-in from the Okta dashboard (IdP-initiated):** off by default, which is safer. To let people start from their
Okta dashboard, either turn on *Allow sign-in from the provider's portal* under the connection's advanced settings
(test and activate again), or hide the SAML app's icon and add an Okta **Bookmark App** that opens
`https://YOUR-HOST/login` (people then select *Continue with single sign-on*).

## OpenID Connect instead of SAML

1. In MoreVoice choose **Okta** with **OpenID Connect**. Copy the **Redirect URI** (`https://YOUR-HOST/api/auth/sso/oidc/callback`).
2. In Okta: **Create App Integration → OIDC - OpenID Connect → Web Application**.
   - Sign-in redirect URIs: the MoreVoice redirect URI. Grant type: **Authorization Code** only.
   - Assignments: the people or groups who should use MoreVoice.
   - Groups (optional): **Sign On → OpenID Connect ID Token → Groups claim type: Filter**, `groups` **Matches regex** `.*`.
3. In MoreVoice, **Connection** step: *Issuer URL* = your Okta domain (`https://acme.okta.com`, or the issuer of a
   custom authorization server), *Client ID*, *Client secret*. Under *Advanced*, keep the extra scope `groups` (preset).
4. Test and activate as above.

## User provisioning with SCIM

SCIM keeps MoreVoice in step with Okta: assigned people are created, their name and email changes follow, unassigned
or deactivated people are suspended, and pushed groups drive roles and teams.

1. In MoreVoice, **Security › Single sign-on › User provisioning (SCIM)**: copy the **SCIM base URL**
   (`https://YOUR-HOST/scim/v2`) and select **New token**. Copy the token (`mvscim_…`): it is shown once.
2. In Okta, open the app → **General → App Settings → Edit → Provisioning: SCIM** → Save.
3. **Provisioning → Integration:**
   - SCIM connector base URL: the MoreVoice SCIM base URL
   - Unique identifier field for users: `userName`
   - Supported provisioning actions: **Push New Users**, **Push Profile Updates**, **Push Groups**
   - Authentication Mode: **HTTP Header** → Authorization: the token
   - **Test Connector Configuration**, then Save.
4. **Provisioning → To App:** enable **Create Users**, **Update User Attributes**, **Deactivate Users**.
5. **Push Groups:** push the groups you want to map to roles or teams.
6. In MoreVoice, **Group mapping → SCIM groups → Add mapping**: map each pushed group to a role and/or a team. Mapping a
   group to *Owner* needs an owner and the group's name typed to confirm.

Okta's username must be the person's email (`userName` = email). Rotate tokens by creating a second one, switching
Okta to it, then revoking the first (two can be active at a time).

## Recommended next steps

- [Require single sign-on](https://docs.morevoice.ai/enterprise/sso/#require-single-sign-on) once everyone can sign in through Okta.
- Plan the [certificate rollover](https://docs.morevoice.ai/enterprise/sso/#certificate-rollover) (Okta: **Sign On → SAML Signing Certificates**).
- Problems? See [troubleshooting](https://docs.morevoice.ai/enterprise/sso-troubleshooting/).
