# Okta

> Sign in to Neurouter with Okta over OpenID Connect and map Okta groups to Neurouter roles and groups for MCP tool access control.

Source: https://neurouter.com/integrations/okta · Last updated: 2026-11-24

Neurouter works with Okta as a standard OpenID Connect provider.

## 1. Create an app integration in Okta

Create an **OIDC – Web Application** integration in the Okta Admin Console:

- **Sign-in redirect URI**: `https://mcp.example.com/api/auth/callback`, that is, your `PUBLIC_URL` followed by `/api/auth/callback`.
- Grant type: **Authorization Code**.
- Assign the people or groups who may sign in.
- Note the **Client ID** and **Client secret**.
- To use groups, configure a **groups claim** named `groups` in the ID token, filtered to the groups Neurouter should see. See Okta's guide to [customizing tokens with a groups claim](https://developer.okta.com/docs/guides/customize-tokens-groups-claim/main/).

## 2. Configure Neurouter

Use your Okta org URL as the issuer, or the issuer of the custom authorization server you added the claim to (for example `https://<your-org>.okta.com/oauth2/default`):

```bash
OIDC_ISSUER=https://<your-org>.okta.com
OIDC_CLIENT_ID=<client-id>
OIDC_CLIENT_SECRET=<client-secret>
OIDC_DISPLAY_NAME="Sign in with Okta"
OIDC_SCOPES="openid email profile"
OIDC_GROUPS_CLAIM=groups
OIDC_ADMIN_GROUPS=neurouter-admins
OIDC_AUDITOR_GROUPS=security-auditors
```

If your authorization server only returns the groups claim when a `groups` scope is requested, add it: `OIDC_SCOPES="openid email profile groups"`.

## How Neurouter uses the claims

- Claims come from the ID token, merged with userinfo where the token doesn't contain them.
- Group names in `OIDC_GROUPS_CLAIM` are matched against `OIDC_ADMIN_GROUPS` and `OIDC_AUDITOR_GROUPS` at every sign-in, and against group mappings in the console. `OIDC_GROUP_AUTO_CREATE=true` creates a Neurouter group for each value.
- Restrict sign-in to your domains with `OIDC_ALLOWED_EMAIL_DOMAINS`.

Then grant servers and tools to those groups under *Administration → Access control*.
