Skip to main content
Context7 On-Premise connects to Microsoft Entra ID (formerly Azure AD) through its standard SSO providers. You can use the SAML 2.0 tab or the OIDC tab in the Single sign-on card. Both work with an Entra tenant, and neither needs an Azure subscription.
  • SAML 2.0 (recommended): you import the Entra metadata URL, and Context7 reads the standard Microsoft claims without extra mapping.
  • OIDC: use it if your organization prefers OpenID Connect app registrations.
This page gives the Entra-specific steps. For the full field reference, see SAML SSO and OIDC SSO.

Before you start

You need:
  • An Entra admin, or someone who can create applications in your tenant.
  • A running Context7 On-Premise instance that you can reach in your browser.
  • A Context7 admin account. On a fresh install it is admin / admin until you change it.
SSO is an addition to password login. The default admin account keeps working after you turn on SSO. You can turn off password login with the Password sign-in card below the SSO card. First make sure that at least one admin can sign in through Entra. If you get locked out, see Recover admin access.
Deployments that already saved settings in the older Microsoft Entra ID tab still see that tab, and their sign-in keeps working. Only one SSO provider can be active at a time, so turning on SAML 2.0 or OIDC turns off sign-in through the Entra tab. If you move to the SAML 2.0 or OIDC tab, Context7 creates a new user record for each person on their first sign-in through the new provider.

Part 1: Create the Enterprise application in Entra

  1. In Context7, open Workspace Settings › Authentication. In the Single sign-on card, select the SAML 2.0 tab. In the Service provider section, click Download metadata.
  2. In the Azure portal, open Microsoft Entra ID › Enterprise applications and click + New application. Click Create your own application, enter Context7, select Integrate any other application you don’t find in the gallery (Non-gallery), and click Create.
  3. Open Single sign-on and select SAML. Click Upload metadata file and upload the Context7 metadata file. This fills in the Identifier (Entity ID), Reply URL and Logout URL. Click Save.
  4. In Attributes & Claims, edit Unique User Identifier (Name ID). Set Name identifier format to Persistent and Source attribute to user.objectid. Context7 recognizes returning users by this value.
  5. In Attributes & Claims, click + Add a group claim. Select Security groups (or Groups assigned to the application), keep Source attribute as Group ID, and click Save.
  6. In SAML Certificates, copy the App Federation Metadata Url.

Part 2: Assign users

By default, every user in your tenant can try to sign in. To restrict access, open Properties on the Context7 Enterprise application, set Assignment required? to Yes, and click Save.
Enterprise app Properties page with Assignment required set to Yes
Then open Users and groups, click + Add user/group, and assign the users or groups that can sign in. Assign yourself, so that you can test the flow.

Part 3: Configure Context7

  1. In the SAML 2.0 tab, turn on Enable SAML 2.0.
  2. Paste the App Federation Metadata Url into IdP metadata URL and click Import. Context7 fills in the IdP entity ID, sign-on URL, logout URL and signing certificate.
  3. Leave the attribute fields blank. Context7 detects the Microsoft email, name and group claims.
  4. In Group mapping, enter the Object ID of the Entra group for admins as Admin group value, and the Object ID of the group for members as Member group value. Entra sends group Object IDs, not group names. If you leave both blank, every assigned user gets the member role.
  5. Click Check configuration, then Save and apply.
Open /login in a private browser window and click the SSO button to test the sign-in.

Option 2: OIDC

Part 1: Register the application in Entra

  1. In the Azure portal, open Microsoft Entra ID › App registrations and click + New registration.
  2. Enter Context7 as the name and select Accounts in this organizational directory only.
  3. For Redirect URI, select Web and enter https://<your-context7-host>/api/auth/oidc/callback. The OIDC tab in Context7 shows the exact URL with a copy button. Click Register.
  4. On the Overview page, copy the Application (client) ID and the Directory (tenant) ID.
  5. In Certificates & secrets, click + New client secret, then copy its Value. Entra shows the value only once.
  6. In Token configuration, click + Add groups claim, select Security groups (or Groups assigned to the application for large tenants), and include it in the ID token. See Users in many groups have no groups.
To restrict who can sign in, open the same app in Enterprise applications, set Assignment required? to Yes, and assign users or groups, as in Option 1, Part 2.

Part 2: Configure Context7

In Workspace Settings › Authentication, select the OIDC tab and turn on Enable OIDC. Fill in the fields: To map Entra app roles instead of groups, set Groups claim to roles and enter the app role values. Library access group grants then match the role values too. Click Check configuration, then Save and apply. Open /login in a private browser window to test the sign-in.

Sign-in from MCP clients

With OAuth sign-in for MCP clients, MCP clients use the same Entra sign-in. After Entra sends the user back, Context7 returns to the client’s consent step. No change to the Entra app registration is needed.

Troubleshooting

AADSTS50011: redirect URI mismatch

The URL that Context7 sent does not match the Reply URL (SAML) or the Redirect URI (OIDC) in Entra. Compare the Entra value with the URL in the Context7 tab. The scheme, host, port and path must match exactly. Behind a reverse proxy, the proxy must send X-Forwarded-Host and X-Forwarded-Proto with your public host and scheme.

A user signs in but cannot get access

None of the user’s groups matches the admin or member group value. Check that the group claim is set up in Entra, and that you entered group Object IDs, not group names.

Users in many groups have no groups

If a user is in more than 150 groups (SAML) or 200 groups (OIDC), Entra leaves out the groups claim, and that user gets no group-based role or library grants. Use Groups assigned to the application in the group claim settings, so that Entra sends only the groups that you assign to Context7.

Client secret expired (OIDC)

Create a new secret in Certificates & secrets, paste the new Value into the OIDC tab, and click Save and apply.

What this does not cover

  • SCIM provisioning. Context7 creates users when they first sign in. It does not sync the whole directory.
  • Revoking sessions. When you remove a user in Entra, their existing Context7 sessions stay valid until they expire, after at most 7 days. To block the user at once, open Members and choose Disable sign-in in the user’s row menu.
If you run into a problem that this page does not cover, contact context7@upstash.com with the Request Id from the Microsoft error page.