Before you start
You will need:- Admin access to your identity provider so you can register a new application.
- A running Context7 On-Premise instance that you can reach in your browser.
- The Context7 admin password. On a fresh install it is
admin/adminuntil you change it.
Only one SSO provider can be active at a time. If you already have SAML configured, enabling OIDC will automatically disable it, and vice versa.
Part 1: Register Context7 in your identity provider
The exact steps depend on your provider, but the end result is the same in every case: you need a client ID, a client secret, and your provider’s issuer URL.What to configure in your IdP
Create a new application or client in your identity provider and set the following:- Application type: Confidential (server-side) web application.
- Allowed grant type: Authorization Code.
- Redirect URI / Callback URL:
https://<your-context7-host>/api/auth/oidc/callback. The exact URL is shown in the Context7 settings card once you open it, and there is a copy button next to it.
code_challenge regardless of whether the provider requires it.
Group claims (for role mapping)
Context7 maps a group claim in the token to admin or member roles. Most providers let you include group membership in the ID token or expose it from the UserInfo endpoint. Either location works; Context7 checks both. In your IdP, configure the application to include the user’s groups in the token. The default claim name Context7 looks for isgroups. Common provider-specific steps:
- Okta: where you configure the claim depends on the issuer URL you use in Part 2.
- Org authorization server (issuer
https://your-org.okta.com): open the app’s Sign On tab and edit the OpenID Connect ID Token section. Set Groups claim type to Filter, name the claimgroups, and add a filter such as Matches regex.*. Addgroupsto the Scopes field in Context7. - Custom authorization server (issuer
https://your-org.okta.com/oauth2/defaultor another custom server): go to Security › API, select the server, and add a claim on the Claims tab. Name itgroups, include it in the ID Token with Always, set Value type to Groups, and add a filter such as Matches regex.*. A server you created yourself (notdefault) also needs an access policy with a rule that allows the Context7 client, or the token request fails. - Group limit: Okta fails the sign-in when more than 100 of a user’s groups match the filter. In large orgs, use a narrower filter such as Starts with
context7-, and make sure it still matches your admin and member groups and every group you use in library access rules.
- Org authorization server (issuer
- Keycloak: enable the
groupsscope or add a Group Membership mapper to the client. - Microsoft Entra ID: in the app registration, open Token configuration and add a groups claim for the ID token. Entra sends group Object IDs. See Microsoft Entra SSO.
- Auth0: add a custom claim action that sets
groupsfrom the user’s app metadata or roles.
Part 2: Configure Context7
1
Open the SSO settings card
Sign in to your Context7 dashboard with the admin account. Open Workspace Settings › Authentication. In the Single sign-on card, select the OIDC tab.

2
Fill in the connection details
Toggle Enable OIDC on, then fill in the fields:
- Button label: the text shown on the sign-in button on the login page. Something like your company name or “Sign in with Acme” works well.
- Issuer URL: your provider’s base URL. Context7 appends
/.well-known/openid-configurationto discover endpoints automatically. For Okta this ishttps://your-org.okta.comfor the org authorization server orhttps://your-org.okta.com/oauth2/defaultfor a custom one (see Group claims), for Keycloak it ishttps://keycloak.example.com/realms/your-realm. - Client ID: the client or application ID from your IdP registration.
- Client secret: the secret generated by your IdP. Context7 stores this encrypted and never returns it to the browser after saving.
- Scopes: space-separated scopes to request. The default
openid profile emailworks for most setups. Addgroupsor any custom scope your IdP requires to include group membership.
3
Configure group mapping
The Group mapping section controls which users get which role in Context7.

- Groups claim: the name of the claim in the token that contains the user’s groups. Default is
groups. - Admin group value: the exact group name that maps to the Context7 admin role. Admins can open workspace settings and manage other users.
- Member group value: the exact group name that maps to the member role. Members can use the workspace but cannot access settings.
4
Test the connection
Click Check configuration before saving. Context7 fetches your provider’s discovery document and confirms that it lists the authorization and token endpoints. The check does not test the client ID or client secret. The issuer URL must use HTTPS, except for
localhost and 127.0.0.1. A green banner means everything looks good. A red error usually means the issuer URL is wrong or the provider is not accessible from the Context7 server.5
Save and apply
Click Save and apply. The status badge in the card header will change to Live.
Part 3: Sign in
Open/login in a new browser window. You will see a Continue with [your button label] button at the top of the sign-in card.

Sign-in from MCP clients
With OAuth sign-in for MCP clients, an MCP client sends the user to this sign-in flow when it needs a token. After the IdP sends the user back, Context7 returns to the client’s consent step instead of the dashboard. Nothing changes in your IdP configuration. An OAuth authorization outlives the browser session: removing a user from the IdP group ends it only when it expires, after at most 30 days. To end it at once, choose Disable sign-in for the user on the Members page.Disabling password sign-in
Once OIDC is live, you can turn off password-based sign-in entirely so that all users must authenticate through your IdP. Open the Password sign-in card directly below the SSO card and toggle it off.
Managing users
All users who have signed in appear on the Members page in Workspace Settings, along with their sign-in method and last sign-in time.
Troubleshooting
”OIDC SSO is not configured”
The toggle is on but some required fields are missing or the config was not saved. Open the OIDC tab in the SSO card and check that Issuer URL, Client ID, and Client secret are all filled in, then click Save and apply.Check configuration fails
The most common reasons are:- Wrong issuer URL: double-check it does not include a trailing slash and points to your realm root. For Keycloak, the format is
https://host/realms/realm-name, nothttps://host/auth/realms/realm-name(the/authprefix was removed in Keycloak 17). - Network access: the Context7 server must be able to reach your IdP’s HTTPS endpoint. If you are running air-gapped or on an internal network, confirm there is no firewall blocking outbound requests to your IdP from the server.
”This account is not assigned a supported Context7 group”
The user authenticated successfully but their token did not contain either of the configured group values. Check that:- The groups claim is included in the token from your IdP (use your IdP’s token preview or decode the returned JWT at jwt.io).
- The Groups claim field in Context7 matches the claim name exactly (case-sensitive).
- The Admin group value or Member group value matches the group name exactly, including casing and spacing.
”Single sign-on session expired. Please try again.”
The short-lived cookie that tracks the in-progress sign-in was lost between the redirect to the IdP and the return. The most common causes are:- Starting the flow on one hostname and returning on a different one (for example,
localhost:3000vslocalhost:5173). - A browser or proxy stripping the session cookie.
- Taking longer than 10 minutes to complete the IdP login, which is when the cookie expires.
Redirect URI mismatch
If your IdP returns a redirect URI error, the callback URL you registered in the IdP does not exactly match what Context7 sends. Copy the Callback URL from the Context7 settings card using the copy button and paste it verbatim into your IdP’s allowed redirect URIs. Pay attention tohttp vs https and the port number.
If Context7 is behind a reverse proxy, make sure the proxy forwards the Host and X-Forwarded-Proto headers correctly so Context7 can build the right callback URL.
For anything not covered here, contact context7@upstash.com.