# Configure SSO

> Connect Agent Router to an OpenID Connect (OIDC) identity provider; single sign-on is the only way to sign in to either console, with no password login.

Enterprise Tier

Single sign-on (SSO) with an existing OpenID Connect (OIDC) identity provider is the only way to sign in to Agent Router, in the Admin Console and the Developer Console alike. Email and password sign-in is not supported.

**Persona:** Platform operator completing onboarding, working with the identity team that owns the corporate identity provider.

**Estimated time:** 30 to 60 minutes, most of it spent registering the OIDC client and exchanging values with the identity team.

## Overview

Agent Router has no local password database, so the identity provider is the only authority on who may sign in. Both consoles authenticate through the same SSO configuration:

- The **Admin Console** (`dashboard.<tenant>.tetrate.ai`), for platform operators.
- The **Developer Console** (`router.<tenant>.tetrate.ai`), for developers.

The guide has two parts:

- **Part 1: [Agent Router configuration](#part-1-agent-router-configuration)**: form expectations, verification, and troubleshooting.
- **Part 2: [Identity provider configuration](#part-2-identity-provider-configuration)**: how to register an OIDC client in the identity provider (IdP) and collect the values needed by the form. Walkthroughs are available for:
  - [Microsoft Entra ID](#microsoft-entra-id)
  - [Google Workspace](#google-workspace)
  - [Auth0](#auth0)
  - [Okta](#okta)
  - [Generic/other OIDC](#other-oidc-providers-keycloak-ping-and-custom)

## When this guide applies

| Situation | What it covers |
| :- | :- |
| First-time SSO configuration on a new tenant | Collecting the Redirect URI, registering an OIDC client, and completing the Configure SSO form |
| Registering Agent Router in a particular identity provider | The per-provider walkthroughs in Part 2 |
| Rotating a client secret | Replacing the credential without interrupting sign-in |
| Switching identity providers | Editing the saved configuration and re-verifying before users are affected |
| Investigating a failed sign-in | The troubleshooting table and the error parameters the identity provider returns |

Mapping identity-provider claims to Agent Router roles is covered in [Configure SSO role mapping](/agent-router-enterprise/guides/identity-and-access-management/single-sign-on/sso-role-mapping-guide/).

## Outcomes

By the end of this guide:

- An OIDC client representing Agent Router is registered in the corporate identity provider, with the tenant's Redirect URI registered against it.
- The Issuer, Client ID, Client Secret, and Discovery URL are recorded and entered in the Configure SSO form.
- At least one administrator email is set, so that the first SSO sign-in produces an account with administrative permissions.
- A sign-in has been completed end to end through the Admin Console or the Developer Console.

## Prerequisites

- Access to the Tetrate onboarding wizard or, once onboarding is complete, the **Settings** page in the Admin Console.
- Cooperation from whoever owns the corporate identity provider, which supplies most form values and must register the tenant's Redirect URI.
- Permission in the identity provider to create an application registration and read its client secret.
- The email addresses of the people who hold administrative permissions from the first sign-in onwards. Agent Router has no password fallback, so this cannot be deferred.

## Process at a glance

1. **Tetrate onboarding wizard**: open the Configure SSO step and click **IdP setup guide** to reveal the Redirect URI. Copy it.
1. **Identity provider**: register an OIDC client using that Redirect URI. The output is an **Issuer**, **Client ID**, and **Client Secret**.
1. **Configure SSO form**: paste the three values and submit.
1. **Verify**: sign in on the Admin Console or Developer Console sign-in page.

The Redirect URI is tenant-specific, so the wizard step comes first.

## Part 1: Agent Router configuration

### Step 1: obtain the Redirect URI

In the Configure SSO step, click the **IdP setup guide** button at the top of the form. A panel opens, titled "Configure your SSO provider", with step-by-step instructions and the **Redirect URI** for the tenant. The format is:

```text
https://api.<tenant>.tetrate.ai/v1/auth/sso/callback/corporate
```

Use the copy icon to copy the URL.

- The hostname is tenant-specific.
- The trailing path ends in the SSO provider ID, `corporate`, and is the same for every customer.
- An organization set up before 0.6 keeps the `auth.<tenant>` URL it registered; that address redirects to the current one, so nothing changes in the identity provider.
- From 0.10.0 each SSO provider signs in with the callback URL stored on it. A provider added from 0.10.0 always uses the `api.<tenant>` URL above, so that is the URL registered in the identity provider for it.
- Most IdPs require the URL to match character-for-character. Any mismatch (scheme, trailing slash, missing path segment) produces a `redirect_uri_mismatch` error at sign-in.

After onboarding, the same values are on the Admin Console's **Settings → SSO** tab, under **Identity Provider Setup**: the **Callback URL** (the Redirect URI), **Application Login URI**, **Allowed Logout URLs**, and **Allowed Origins**, each with a copy icon.

![Identity Provider Setup on the Settings SSO tab, listing the Callback URL, Application Login URI, Allowed Logout URLs, and Allowed Origins](/img/screenshots/agent-router-enterprise/guides/identity-and-access-management/sso-settings-idp-setup.jpeg)

:::tip
Copy the URL from the IdP setup guide panel rather than typing it from memory or copying it from this document.
:::

### Step 2: register an OIDC client in the identity provider

Use the Redirect URI from Step 1 to register an OIDC client in the identity provider. Walkthroughs for each supported IdP are in [Part 2: Identity provider configuration](#part-2-identity-provider-configuration). The output is an **Issuer**, **Client ID**, and **Client Secret**.

### Step 3: fill in the Configure SSO form

#### Issuer (identity provider URL)

The base URL of the OIDC provider. Agent Router uses it to discover other endpoints (authorization, token, userinfo, JWKS) and to validate the `iss` claim in incoming ID tokens.

Common values:

| IdP | Issuer format |
| :- | :- |
| Entra ID | `https://login.microsoftonline.com/<TENANT_ID>` |
| Google | `https://accounts.google.com` |
| Auth0 | `https://<DOMAIN>/` |
| Okta | `https://<tenant>.okta.com` or `https://<tenant>.okta.com/oauth2/default`, depending on the [authorization server](#choose-an-authorization-server) |
| Keycloak | `https://<keycloak-host>/realms/<realm>` |

The Issuer must match the `iss` claim in the IdP's ID tokens exactly. Sign-in failures with no obvious cause usually trace back to an Issuer typo: trailing slash, missing tenant ID, wrong region.

Entra ID is the exception. The Authority URL (`https://login.microsoftonline.com/<TENANT_ID>`) resolves to Entra's v1 discovery document, so its ID tokens carry `iss` as `https://sts.windows.net/<TENANT_ID>/`. From 0.6.2 and 0.7.1, Agent Router accepts a token whose `iss` matches either the configured Issuer or the `issuer` advertised by the Issuer's discovery document, so an Authority URL Issuer needs no change. Tenant pinning is kept: an Issuer for `/common` or `/organizations` is still refused.

#### Client ID

The OIDC client ID issued by the IdP.

#### Client secret

The confidential credential paired with the Client ID. This value is shown only once at creation. Copy it into the form immediately, or store it in a secrets manager.

#### Discovery URL

The full URL to the IdP's OpenID Connect metadata document:

```text
<Issuer>/.well-known/openid-configuration
```

:::note
Agent Router validates the URL on submit by fetching it and confirming the JSON includes `issuer`, `authorization_endpoint`, and `token_endpoint`. If those are missing or the URL is unreachable, the form returns *Invalid OIDC discovery URL*.
:::

From 0.10.0, sign-in also fetches the discovery document from the saved Discovery URL. A provider with no saved Discovery URL uses `<Issuer>/.well-known/openid-configuration`, as before.

#### Scopes

Use `openid, profile, email`.

Some providers gate group memberships behind an additional scope, which matters for deployments that drive roles from directory groups. Okta is the common case and needs `groups` added here; see [Emit group claims for role mapping](#emit-group-claims-for-role-mapping). Microsoft Entra ID emits groups and app roles through token configuration instead, with no extra scope.

From 0.10.0, sign-in requests the scopes saved here, and always adds `openid` and `email` when they are missing. A provider with no saved scopes requests `openid email profile`. Before 0.10.0 the saved scopes were not sent, so a provider that already has a scope such as `groups` saved starts returning the extra claims at the first sign-in after the upgrade; the [role mapping](#how-sso-interacts-with-role-mapping) is checked against those claims.

#### Admin emails

The email addresses granted Agent Router administrator permissions on first SSO login. At least one address is required. Without it, the initial SSO sign-in lands in a standard user account, and because Agent Router has no email and password fallback, administrative functions are permanently locked out.

:::warning
Add at least one address here before submitting the form. If lockout does occur, the only remedy is to contact Tetrate Support to reset the SSO configuration.
:::

This field only bootstraps administrative access. Once one person holds Super Admin, further Super Admins and every other role are granted from **Directory → Access** in the Admin Console, as described in [Manage roles and permissions](/agent-router-enterprise/guides/identity-and-access-management/manage-roles-and-permissions/).

#### Attribute mapping

Maps the Agent Router email user attribute to the matching claim name in the IdP's ID token. The default is `email → email`, which works for Google, Auth0, Okta, and Keycloak as registered in this guide. Entra requires an optional claim to be added before it emits `email`; see the [Microsoft Entra ID](#microsoft-entra-id) section.

When the ID token has no `email` claim, or its value is not an email address, Agent Router uses the first email-shaped value among `upn`, `preferred_username`, and `unique_name`, in that order. An address taken from a fallback claim is never marked verified. Emitting `email` is still recommended: Agent Router matches users by exact-case email, so a mixed-case `upn` can create a second account next to an existing lowercase one.

### Step 4: submit the form

Click **Configure**. Agent Router validates the discovery URL synchronously. A successful response means:

- The discovery document was reachable from Agent Router's management plane.
- It contained the required OIDC metadata fields.

It does **not** mean the Client ID or Client Secret are correct. Those are exercised on the first sign-in attempt.

### Step 5: verify

After the form accepts the configuration, sign in via the **Admin Console** or **Developer Console** sign-in page. Both delegate to the IdP, and a successful flow lands back in Agent Router signed in as the IdP user.

If the redirect lands on an error page, the URL usually carries an error query parameter (`redirect_uri_mismatch`, `invalid_client`, `consent_required`) that pinpoints the cause. If sign-in succeeds but the Admin Console shows an empty email or no admin permissions, see the [troubleshooting table](#troubleshooting-and-common-errors).

### Confirm the claims in the ID token

Three common SSO problems are invisible from the sign-in screen and obvious in the ID token: an `iss` value that does not match the configured Issuer, a missing `email` claim, and a missing groups or roles claim. Reading the token shows which side of the integration is at fault before any configuration is changed. This applies to every provider in Part 2.

Agent Router exchanges the authorization code server-side, so the token never passes through the browser. To obtain one, run the same flow by hand against the identity provider:

1. Register a second, throwaway redirect URI on the OIDC client, such as `http://localhost:8080/callback`. Every provider in Part 2 accepts more than one. Leave the Tetrate Redirect URI in place.
1. Read the endpoints from the discovery document:

    ```bash
    curl -s "<Issuer>/.well-known/openid-configuration" \
     | jq -r '.authorization_endpoint, .token_endpoint'
    ```

1. Open the authorize URL in a browser and authenticate as a test user. Add `groups` to the scope list when the point of the exercise is to confirm a group claim:

    ```text
    <authorization_endpoint>?client_id=<CLIENT_ID>&redirect_uri=http://localhost:8080/callback&response_type=code&scope=openid%20profile%20email&state=check
    ```

1. The browser lands on a dead `localhost` address carrying `?code=...`. Copy the code value out of the address bar.
1. Exchange the code for tokens:

    ```bash
    curl -s -X POST "<token_endpoint>" \
      -u "<CLIENT_ID>:<CLIENT_SECRET>" \
      -d grant_type=authorization_code \
      -d code="<CODE>" \
      -d redirect_uri=http://localhost:8080/callback \
     | jq -r .id_token
    ```

1. Remove the throwaway redirect URI once the check is finished.

Authorization codes are single-use and expire quickly, so the exchange has to follow the browser step promptly. Where a provider rejects the credentials sent by `-u`, send them as form fields instead by adding `-d client_id=<CLIENT_ID> -d client_secret=<CLIENT_SECRET>`. Where the client is configured to require Proof Key for Code Exchange (PKCE), the manual flow additionally needs a `code_challenge` and `code_verifier` pair; none of the walkthroughs in Part 2 enable PKCE.

Decode the payload locally, not in an online decoder: an ID token identifies a real user and is treated as a credential.

```bash
jq -R 'split(".")[1] | gsub("-";"+") | gsub("_";"/") | @base64d | fromjson' <<<"$ID_TOKEN"
```

What to look for in the output:

| Claim | Expectation |
| :- | :- |
| `iss` | Matches the **Issuer** in the Configure SSO form character-for-character, including the presence or absence of a trailing slash. For Entra ID with the Authority URL as Issuer, `iss` is `https://sts.windows.net/<TENANT_ID>/` instead, which is expected (see [Issuer](#issuer-identity-provider-url)) |
| `aud` | Contains the **Client ID** configured in Agent Router |
| `email` | Present and populated. An absent or differently named claim is the cause behind the *empty email* row in the troubleshooting table, and is corrected through **Attribute Mapping** |
| `groups` or `roles` | Present only where the provider has been configured to emit it. Claim-driven role mapping depends on it, and the name seen here is the one the mapping configuration has to reference |
| `exp` | A Unix timestamp in the future. A token that already looks expired points at clock skew rather than at configuration |

Two providers offer a shortcut. Okta exposes a **Token Preview** tab on a custom authorization server, which mints a token for a chosen user and client with no browser round-trip (unavailable on the org authorization server this guide recommends). Google decodes and validates a token in a single call to `https://oauth2.googleapis.com/tokeninfo?id_token=<ID_TOKEN>`, supported for debugging only.

### Troubleshooting and common errors

| Symptom | Cause | Fix |
| :- | :- | :- |
| *Invalid OIDC discovery URL* on form submit | Issuer typo, IdP unreachable from the auth pod, or IdP returns 404 / non-JSON at `/.well-known/openid-configuration` | Verify the discovery URL is reachable: `curl <Issuer>/.well-known/openid-configuration \| jq -r '.issuer, .authorization_endpoint, .token_endpoint'` |
| Signed in but Agent Router shows an empty email | ID token has no `email` claim, or claim name is non-standard. For Entra ID, none of `upn`, `preferred_username`, or `unique_name` holds an email-shaped value either (for example, `upn` is `CORP\alice`) | [Decode the ID token](#confirm-the-claims-in-the-id-token) to find the actual claim name, then update **Attribute Mapping** to point at it, or add `email` as an emitted claim in the IdP |
| Signed in but no admin permission | Email was not in **Admin emails** at the time of first SSO sign-in | Contact Tetrate Support to reset SSO and re-run with **Admin emails** populated |

For IdP-side errors (`redirect_uri_mismatch`, `invalid_client`, callback mismatch), see the IdP's documentation.

### Edit the SSO configuration after onboarding

After onboarding, the same form is editable from the **Settings** page in the Admin Console sidebar (**SSO** tab). SSO cannot be turned off, but the values can be swapped to point at a different IdP.

To rotate the Client Secret without downtime, create a new secret in the IdP, update **Client Secret** in Agent Router, verify that sign-in works, then delete the old secret in the IdP.

### Switch identity providers

Agent Router uses one identity provider at a time. Switching replaces the saved configuration, and there is no parallel-run mode, so a mistake affects every user at once. The least disruptive sequence:

1. Register the OIDC client in the incoming identity provider and collect its Issuer, Client ID, Client Secret, and Discovery URL before anything is changed in Agent Router.
1. Where a separate test tenant exists, point that tenant at the new provider first and verify a sign-in there.
1. In production, edit **Settings → SSO** and replace the Issuer, Client ID, Client Secret, and Discovery URL in a single change.

    :::warning Before 0.8.0
    On a management plane before 0.8.0, moving the provider to a different identity provider kept the previous provider's endpoints, so sign-in could keep going to the old identity provider with the new Client ID and lock out every user not already signed in. From 0.8.0, a switch to a different identity provider replaces the endpoints, and an edit that keeps the same provider keeps any explicitly configured endpoints.
    :::

1. Verify a sign-in immediately, using the checks in [Step 5](#step-5-verify).
1. Coordinate the cutover with the identity team so that the Agent Router-side and provider-side changes happen close together.
1. For any deployment with a non-trivial number of users, announce the change at least one business day in advance. See [Communicate with Agent Router users](/agent-router-enterprise/guides/operate-and-govern/communicate-with-platform-users/).

### Multi-factor authentication

Multi-factor authentication (MFA) is whatever the identity provider enforces. Agent Router delegates the entire login screen to the provider, so MFA prompts, conditional access policies, and device checks apply there with no configuration in Agent Router.

### How SSO interacts with role mapping

SSO settles who is signing in; role mapping settles which Agent Router role that user holds. The two are configured on the same surface but are otherwise independent.

Without role mapping, every SSO user lands with the default user role, apart from the addresses listed in **Admin emails**, and elevated roles are assigned by hand in the Admin Console. A change in the directory has no effect on Agent Router until an operator edits the user record.

With role mapping, the claims the identity provider returns (assigned application roles or group memberships) are translated into Agent Router roles on every login, so the directory is the source of truth. See [Configure SSO role mapping](/agent-router-enterprise/guides/identity-and-access-management/single-sign-on/sso-role-mapping-guide/).

### SSO changes in the audit log

A change to the SSO configuration is recorded in the audit log as an `sso.configured` event, alongside every other administrative change. See [Audit Agent Router activity](/agent-router-enterprise/guides/operate-and-govern/compliance-and-governance/audit-platform-activity/).

A sudden run of failing sign-ins is usually preceded either by a recent `sso.configured` event or by an identity-provider-side change that no Agent Router audit log captures. Checking the audit log first rules out the former.

## Part 2: identity provider configuration

Each walkthrough registers an OIDC client in one supported identity provider and opens with the values it produces, so it can be handed to the identity team as a checklist. Only the section for the provider in use applies.

:::note
The auth service is removed in 0.11.0, and the management API serves every sign-in path, including the auth host. URLs on `auth.<tenant>.tetrate.ai` and existing identity provider callbacks keep working, so nothing needs to change.
:::

### Microsoft Entra ID

#### What it produces

| Value | Where it comes from |
| :- | :- |
| **Issuer** | App registration → Overview → Endpoints → Authority URL |
| **Discovery URL** | App registration → Overview → Endpoints → OpenID Connect metadata document |
| **Client ID** | App registration → Overview → Application (client) ID |
| **Client Secret** | App registration → Certificates & secrets → New client secret |

One value is registered **in Entra**: the **Redirect URI** for the Tetrate tenant.

#### Prerequisites

- Access to the Microsoft Entra ID instance.
- The Tetrate **Redirect URI**. Open the **IdP setup guide** panel in the Configure SSO step to find it.

#### Step 1: create an app registration

In the Entra admin center, go to **App registrations** and click **+ New registration**. Fill in the name and complete the form.

#### Step 2: add the Redirect URI

In the app registration, click **Authentication** in the left sidebar.

- Click **+ Add a platform**, then choose **Web**.
- Paste the Redirect URI from the Tetrate onboarding form.
- Click **Configure**.

#### Step 3: add optional claims

In the app registration, click **Token configuration** in the left sidebar, then **+ Add optional claim**.

| Field | Value |
| :- | :- |
| Token type | **ID** |
| Claims | Tick `email` |

Click **Add**. Without this claim, Agent Router falls back to `upn` and related claims, as described under [Attribute mapping](#attribute-mapping).

#### Step 4: generate a client secret

In the app registration, click **Certificates & secrets** in the left sidebar, then **+ New client secret**.

- Add a description, choose an expiry, and click **Add**.
- Copy the Value column immediately and store it in a secrets manager. Once the page closes, Entra does not reveal it again.

#### Step 5: collect the Issuer URL and Client ID

In the app registration **Overview**:

- Click **Endpoints** in the top toolbar. A drawer opens with several URLs.
- Copy the **Authority URL** (use as the Tetrate **Issuer**).
- Copy the **OpenID Connect metadata document** URL (use as the Tetrate **Discovery URL**).
- Copy **Application (client) ID** (use as the Tetrate **Client ID**).

#### Done in Entra

The collected values are:

- Issuer, the Authority URL.
- Discovery URL, the OpenID Connect metadata document URL.
- Client ID.
- Client Secret.

Return to [Part 1: Agent Router configuration](#part-1-agent-router-configuration) and paste them into the Configure SSO form.

### Google Workspace

#### What it produces

| Value | Where it comes from |
| :- | :- |
| **Issuer** | `https://accounts.google.com` (fixed) |
| **Discovery URL** | `https://accounts.google.com/.well-known/openid-configuration` (fixed) |
| **Client ID** | APIs & Services → Credentials → OAuth client ID |
| **Client Secret** | APIs & Services → Credentials → OAuth client ID |

Two values are registered **in Google**: the **Authorized redirect URI** and the **Authorized JavaScript Origins** for the Tetrate tenant.

#### Prerequisites

- A Google Cloud project.
- IAM permission on the project to manage OAuth credentials.
- The Tetrate **Redirect URI**. Open the **IdP setup guide** panel in the Configure SSO step to find it.

#### Step 1: create OAuth credentials

Go to **Google Cloud Console → APIs & Services → Credentials** and click **Create Credentials → OAuth client ID**.

#### Step 2: configure the consent screen

Add:

- App name.
- Support email.
- Scopes: `openid`, `profile`, `email`.

#### Step 3: set the Redirect URI

Set the **Authorized redirect URI** to the Tetrate Redirect URI:

```text
https://api.<tenant>.tetrate.ai/v1/auth/sso/callback/corporate
```

#### Step 4: set authorized JavaScript origins

Set **Authorized JavaScript Origins** to the three Tetrate hostnames for the tenant:

```text
https://auth.<tenant>.tetrate.ai
https://dashboard.<tenant>.tetrate.ai
https://router.<tenant>.tetrate.ai
```

#### Step 5: save credentials

Copy:

- **Client ID**.
- **Client Secret**.

#### Done in Google

The collected values are:

- Issuer: `https://accounts.google.com`.
- Discovery URL: `https://accounts.google.com/.well-known/openid-configuration`.
- Client ID.
- Client Secret.

Return to [Part 1: Agent Router configuration](#part-1-agent-router-configuration) and paste them into the Configure SSO form.

### Auth0

:::tip Evaluation walkthrough
For a ground-up Auth0 path (new tenant through credentials ready for onboarding), see [Set up Auth0 for evaluation](/product-architecture/product-evaluation/auth0-for-evaluation/).
:::

#### What it produces

| Value | Where it comes from |
| :- | :- |
| **Issuer** | Build from the Auth0 Domain: `https://<DOMAIN>/` *(trailing slash)* |
| **Discovery URL** | Build from the Auth0 Domain: `https://<DOMAIN>/.well-known/openid-configuration` |
| **Client ID** | Applications → app → Settings |
| **Client Secret** | Applications → app → Settings |

Three values are registered **in Auth0**: the **Callback URL**, **Allowed Web Origins**, and (optionally) the **Logout URL** for the Tetrate tenant.

#### Prerequisites

- An Auth0 tenant.
- A role that allows creating applications and viewing secrets.
- The Tetrate **Redirect URI**. Open the **IdP setup guide** panel in the Configure SSO step to find it.

#### Step 1: create the application

- Go to the **Auth0 Dashboard**.
- Select **Applications**.
- Click **+ Create Application**.
- Select **Create Manually**.
- Enter a recognizable name, such as `Tetrate Agent Router Enterprise`.
- Select **Regular Web Application**.
- Click **Create**.

#### Step 2: configure application details

On the **Settings** tab of the new application:

- Under **Basic Information**, copy the `Domain`, `Client ID`, and `Client Secret` values into a secrets manager or scratch file. The Issuer is built from the Domain in Step 4.
- Under **Application URIs**, set **Allowed Callback URLs** to the Tetrate Redirect URI: `https://api.<tenant>.tetrate.ai/v1/auth/sso/callback/corporate`
- Under **Application URIs**, set **Allowed Web Origins** to the Tetrate hostnames for the tenant, listed as **Allowed Origins** on the Admin Console's **Settings → SSO** tab:

```text
https://dashboard.<tenant>.tetrate.ai
https://auth.<tenant>.tetrate.ai
https://router.<tenant>.tetrate.ai
https://app.<tenant>.tetrate.ai
```

#### Step 3: set the logout URL (optional)

Still under **Application URIs**, set **Allowed Logout URLs** to:

```text
https://auth.<tenant>.tetrate.ai
```

Click **Save**.

#### Step 4: save credentials, if not already done

From the application **Settings** tab, copy:

- **Domain**: build the Issuer as `https://<Domain>/` (with trailing slash). For example, `acme.us.auth0.com` becomes `https://acme.us.auth0.com/`.
- **Client ID**.
- **Client Secret**.

#### Done in Auth0

The collected values are:

- Issuer: `https://<DOMAIN>/` *(trailing slash)*.
- Discovery URL: `https://<DOMAIN>/.well-known/openid-configuration`.
- Client ID.
- Client Secret.

Return to [Part 1: Agent Router configuration](#part-1-agent-router-configuration) and paste them into the Configure SSO form.

### Okta

The authorization server that issues the tokens is decided before the wizard is opened. It determines the Issuer value, the discovery URL, and where group claims are configured.

#### Choose an authorization server

Okta can issue tokens from either of two authorization servers, which are not interchangeable:

| | Org authorization server | Custom authorization server |
| :- | :- | :- |
| Issuer | `https://<tenant>.okta.com` | `https://<tenant>.okta.com/oauth2/<serverId>`, commonly `.../oauth2/default` |
| Discovery URL | `https://<tenant>.okta.com/.well-known/openid-configuration` | `https://<tenant>.okta.com/oauth2/<serverId>/.well-known/openid-configuration` |
| Availability | Present in every Okta org | Requires the API Access Management add-on, which is licensed separately in production orgs |
| Group claims configured on | The application's **Sign On** tab | The authorization server's **Claims** tab |
| Custom scopes and claims | Not supported | Supported |

The org authorization server is the default choice: it exists in every org, issues the ID token Agent Router consumes, and supports the groups claim that role mapping depends on. A custom authorization server is necessary only where the same server also protects the organization's own APIs and API Access Management is already licensed. Picking `.../oauth2/default` without that entitlement leaves the endpoint absent, which surfaces as an unreachable discovery URL on form submit.

Agent Router validates the ID token only, so the [caveats Okta documents around access-token validation](https://developer.okta.com/docs/concepts/auth-servers/) on the org authorization server do not apply here.

#### What it produces

| Value | Where it comes from |
| :- | :- |
| **Issuer** | Security → API → **Authorization Servers** → **Issuer URI** of the server chosen above |
| **Discovery URL** | Build from the Issuer: `<Issuer>/.well-known/openid-configuration` |
| **Client ID** | Applications → app → **General** tab → **Client Credentials** |
| **Client Secret** | Applications → app → **General** tab → **Client Credentials** |

Two values are registered **in Okta**: the **Sign-in redirect URI** and, optionally, the **Sign-out redirect URI** for the Tetrate tenant.

#### Prerequisites

- An Okta org, and an administrator role that allows creating app integrations and reading client secrets.
- The Tetrate **Redirect URI**. Open the **IdP setup guide** panel in the Configure SSO step to find it.
- A decision on the authorization server, as above.

#### Step 1: create the app integration

In the Okta Admin Console, go to **Applications → Applications** and click **Create App Integration**. Where the org offers a choice of wizard, select **Classic experience**.

- Sign-in method: **OIDC (OpenID Connect)**.
- Application type: **Web Application**.
- Click **Next**.

A Web Application is a confidential client, which is what allows Okta to issue the client secret Agent Router authenticates with. Selecting a single-page or native application produces a public client with no secret, and the sign-in flow then fails at the token exchange.

#### Step 2: configure the redirect URIs

Under **General Settings**:

- **App integration name**: a recognizable name, such as `Tetrate Agent Router Enterprise`.
- **Grant type**: leave **Authorization code** selected. It is required for this flow and cannot be cleared.
- **Sign-in redirect URIs**: the Tetrate Redirect URI, exactly as copied from the IdP setup guide panel.

```text
https://api.<tenant>.tetrate.ai/v1/auth/sso/callback/corporate
```

- **Sign-out redirect URIs** (optional): `https://auth.<tenant>.tetrate.ai`. Absolute URIs only; wildcard subdomains are not accepted in this field.

Leave **Allow wildcard in sign-in redirect URI** unselected. A single tenant needs exactly one redirect URI, and Okta cautions that subdomain wildcards can allow authorization codes to be sent to an attacker-controlled page.

The **Trusted Origins** section of the wizard, with its optional **Base URIs** field, governs cross-origin browser calls to the Okta API. It is not required for the server-side authorization code exchange Agent Router performs.

#### Step 3: set client authentication

In **Client Credentials**, confirm **Client authentication** is set to **Client secret** rather than **Public key / Private key**. Agent Router authenticates to the token endpoint with a client secret, and there is no field in the Configure SSO form for a private key. **Proof Key for Code Exchange (PKCE)** may be left at its default.

#### Step 4: set controlled access

The **Assignments** section governs who may sign in. Under **Controlled access**, either allow everyone in the organization, or select **Limit access to selected groups** and name the groups that should reach Agent Router. Click **Save**.

Okta enforces this before Agent Router sees the user, so an unassigned user is refused at the identity provider regardless of Agent Router configuration. Assignment also restricts Agent Router to a pilot group during a phased rollout. Choosing **Skip group assignment for now** leaves the application with no one assigned, and every sign-in attempt then fails.

#### Step 5: collect the Client ID and Client Secret

On the application's **General** tab, under **Client Credentials**, copy:

- **Client ID**.
- **Client secret**. Copy it into the Configure SSO form immediately or store it in a secrets manager. Okta reveals the value once.

#### Step 6: confirm the Issuer URL

Go to **Security → API → Authorization Servers** and copy the **Issuer URI** of the server chosen in the first step. Rather than transcribing it, confirm the canonical value by reading the discovery document, and use whatever the `issuer` field returns:

```bash
curl -s "<Issuer>/.well-known/openid-configuration" | jq '.issuer, .authorization_endpoint, .token_endpoint'
```

An Issuer mismatch is the most common cause of an Okta sign-in that fails with no informative error, and Okta issuers have several ways of looking almost right:

- No trailing slash. Neither form of Okta issuer ends in `/`, unlike Auth0.
- The domain suffix follows the cell the org lives in: `okta.com`, `okta-emea.com` for EMEA cells, or `oktapreview.com` for preview and sandbox orgs. A value copied from a sandbox runbook does not work against production.
- Where the org uses a [custom domain](https://developer.okta.com/docs/guides/custom-url-domain/main/), an `issuer_mode` setting decides whether tokens carry the Okta org URL or the custom domain. The configured Issuer has to match whichever one the tokens actually assert. Disabling a custom domain resets `issuer_mode` back to the org URL, which changes the `iss` value and breaks sign-in with no change on the Agent Router side.

The `openid`, `profile`, and `email` scopes are standard, and Okta emits a standard `email` claim in the ID token, so the default `email → email` attribute mapping needs no change.

#### Done in Okta

The collected values are:

- Issuer, the Issuer URI of the authorization server.
- Discovery URL, the Issuer with `/.well-known/openid-configuration` appended.
- Client ID.
- Client Secret.

Return to [Part 1: Agent Router configuration](#part-1-agent-router-configuration) and paste them into the Configure SSO form.

#### Emit group claims for role mapping

Group claims are only needed where roles, rate limits, or budgets are driven from directory membership. Base sign-in works without them.

Okta does not emit group memberships by default. On the org authorization server, the claim is configured on the application rather than centrally:

1. In the Okta Admin Console, go to **Applications → Applications** and select the application created above.
1. Open the **Sign On** tab and click **Edit** in the **OpenID Connect ID Token** section.
1. Set **Group claim type** to **Filter**.
1. Under **Group claims filter**, leave the claim name as `groups`, or enter it if the field is empty.
1. Set the filter to **Matches regex** with a value of `.*` to return every group the user belongs to. A narrower regex is preferable in a large org, so that the token carries only the groups Agent Router maps.
1. Click **Save**, then return to the applications list, open the **More** menu, and choose **Refresh Application Data**.

On a custom authorization server the equivalent is configured under **Security → API**, on the chosen server's **Claims** tab, which also allows the claim in access tokens. Okta's [groups claim guide](https://developer.okta.com/docs/guides/customize-tokens-groups-claim/main/) covers both paths, including the expression syntax needed for groups sourced outside Okta, such as those synchronized from Active Directory.

Two details decide whether the claim actually arrives:

- **The `groups` scope has to be requested.** Okta returns the claim only when `groups` is among the requested scopes, so the Scopes field in the Configure SSO form needs `openid, profile, email, groups` rather than the default three.
- **The flow has to return a full ID token.** Okta issues what it calls a thin ID token, carrying base claims only and omitting groups, for implicit and several other flows. The authorization code flow Agent Router uses returns the full token, so the claim is present once the two points above are satisfied.

Agent Router draws no distinction between providers at the mapping layer: Okta groups drive role assignment, rate limits, and budgets exactly as Entra ID groups do. The claim-to-role mechanics are in [Configure SSO role mapping](/agent-router-enterprise/guides/identity-and-access-management/single-sign-on/sso-role-mapping-guide/), and group-to-business-function mapping (written against Entra ID, applicable to Okta groups unchanged) is in [Map Entra ID groups to business functions](/agent-router-enterprise/guides/identity-and-access-management/single-sign-on/map-entra-id-groups-to-business-functions/).

#### Rotate an Okta client secret

Okta supports two concurrently active client secrets, which allows the rotation in [Edit the SSO configuration after onboarding](#edit-the-sso-configuration-after-onboarding) without a sign-in outage:

1. On the **General** tab, under **Client Credentials**, click **Generate new secret**. Both secrets are now valid.
1. Update **Client Secret** in Agent Router with the new value and confirm a sign-in succeeds.
1. Set the old secret's status to **Inactive** in Okta.
1. Delete the inactive secret. The limit is two, so the old one has to be removed before the next rotation.

#### Okta-specific troubleshooting

| Symptom | Cause | Fix |
| :- | :- | :- |
| Okta reports the user is not assigned to the application | The signing-in user is not in the application's **Assignments**, directly or through a group | Assign the user or their group under **Assignments**, or widen **Controlled access** |
| `redirect_uri_mismatch` at sign-in | **Sign-in redirect URIs** does not match the Tetrate Redirect URI character-for-character | Re-copy the value from the **IdP setup guide** panel; check scheme, trailing slash, and the full `/v1/auth/sso/callback/corporate` path |
| `invalid_client` at the token exchange | Wrong Client ID or Client Secret, or the app was created as a public client | Re-copy both values from **Client Credentials**; confirm the app is a **Web Application** with **Client authentication** set to **Client secret** |
| Sign-in succeeds but no groups reach Agent Router | The `groups` scope is not requested, or no group claim is configured on the app | Add `groups` to the Scopes field and configure the claim as described above, then [decode the ID token](#confirm-the-claims-in-the-id-token) to confirm the claim now arrives |
| Sign-in worked previously and now fails with no configuration change | A custom domain was enabled or disabled in Okta, changing the `iss` value the tokens assert | Re-read the discovery document and update the **Issuer** to match |

### Other OIDC providers (Keycloak, Ping, and custom)

The flow matches the supported IdPs above; only the IdP UI changes. From the IdP, register a **Web application**, set the Redirect URI to the value Agent Router's form supplies, enable the `openid`, `profile`, `email` scopes, generate a client secret, and collect Issuer, Client ID, and Client Secret.

For the Issuer, find the IdP's OIDC discovery URL and check that it returns valid JSON with `issuer`, `authorization_endpoint`, and `token_endpoint`:

```bash
curl -s "<Issuer>/.well-known/openid-configuration" \
 | jq '.issuer, .authorization_endpoint, .token_endpoint'
```

The value `.issuer` returns is what goes into the Agent Router **Issuer** field. Even small differences (trailing slash, version path) break sign-in.

Where to go next

  <Link to="/agent-router-service/quickstarts/quickstart-console/" className="tare-nav-card">
    Console quickstart
    Issue an API key and confirm a first routed request once SSO is working and the gateway is reachable.
  </Link>
  <Link to="/agent-router-enterprise/quickstarts/quickstart-admin-console/" className="tare-nav-card">
    Admin Console quickstart
    Review models, providers, users, and usage analytics from the management plane.
  </Link>
  <Link to="/agent-router-enterprise/guides/identity-and-access-management/single-sign-on/sso-role-mapping-guide/" className="tare-nav-card">
    SSO role mapping (optional)
    After base SSO is verified, map OIDC roles and groups to Agent Router roles.
  </Link>
  <Link to="/agent-router-enterprise/self-hosted-data-plane/" className="tare-nav-card">
    Self-hosted path
    The full self-hosted sequence, the next step before developer handoff where SSO was deferred during onboarding.
  </Link>
  <Link to="/agent-router-enterprise/guides/identity-and-access-management/single-sign-on/map-entra-id-groups-to-business-functions/" className="tare-nav-card">
    Map Entra ID groups to business functions
    Drive roles, rate limits, and budgets from directory group membership.
  </Link>
  <Link to="/agent-router-enterprise/guides/operate-and-govern/compliance-and-governance/audit-platform-activity/" className="tare-nav-card">
    Audit Agent Router activity
    The configuration change made here is one of the administrative events the audit log records.
  </Link>
  <Link to="/agent-router-enterprise/guides/operate-and-govern/run-multiple-platform-instances/" className="tare-nav-card">
    Run multiple Agent Router instances
    SSO is configured per instance, and the multi-instance considerations are non-trivial.
  </Link>
