Authenticate users with your identity provider
Let people sign in to a custom Zone with the work accounts they already have. When an agent acts for them, policy sees their email and groups.
- Your identity provider Your employee signs in with the account they already have.
- Keycard Zone The Zone matches them to their User, or creates one at their first sign-in if directory sync hasn’t already.
- Policy Each time an agent asks for access for them, policy decides with their email and groups.
- Agent If policy allows it, the agent gets a credential, authorized for that person even when it’s a shared stored key.
This guide configures sign-in for a custom Zone. If you’re evaluating Keycard in your organization Zone, you can use your existing Keycard sign-in. For your team’s Console sign-in, see workforce SSO.
Before you start
Section titled “Before you start”You need Manager access to a custom Zone and admin access to your identity provider. To test sign-in, have a protected MCP server or application in that Zone that you can connect a client to.
Connect your identity provider
Section titled “Connect your identity provider”-
Copy your Zone’s redirect URL
From your organization Zone, open Zones and choose ⋯ → Switch to zone on your Zone’s card. Inside the Zone, open Zone → Settings → Connection and copy the Redirect URL, not the Issuer URL above it.
Keycard ConsoleLocation: Settings under Zone → Connection (inside the Zone)Zone configuration
OAuthOAuth endpoints for the zone- Issuer URL
- Base URL for OAuth/OIDC issuer (use this for MCP Server SDK configuration)
https://<zone-id>. keycard. cloud
- Redirect URL
- Callback URL to configure in your Identity Provider (Okta, Google, etc.)
https://<zone-id>. keycard. cloud/ oauth/ 2/ redirect
Paste Redirect URL into your identity provider as the application’s sign-in redirect URI. Issuer URL is this Zone’s own issuer, which neither your identity provider nor the Provider you create in step 3 uses. -
Register an application with your identity provider
Create an OpenID Connect web application and use the URL you copied as its sign-in redirect URI. Keep its issuer, client ID, and client secret for the next step.
Keycard requires an
emailclaim in the ID token and sends the client secret usingclient_secret_post. Configure those settings with your provider:In Okta Admin Console, open Applications and Resources → Applications → Create App Integration. Choose OIDC - OpenID Connect, then Web Application. Add the redirect URL under Sign-in redirect URIs, and assign the people who should sign in.
Copy the client ID and secret from General. For Okta’s org authorization server, the issuer is
https://<your-domain>.okta.com, without a trailing/.Open App registrations → New registration and choose the single-tenant option. Under Authentication, add the redirect URL as a Web redirect URI.
Copy Application (client) ID and Directory (tenant) ID from Overview. Create a secret under Certificates & secrets and copy its Value.
Use
https://login.microsoftonline.com/<tenant-id>/v2.0as the issuer. Keycard needs the tenant ID here; thecommonandorganizationsendpoints won’t work. Each person who signs in must have an email address on their Entra account.By default, anyone in your tenant, including invited guests, can sign in. To limit it, open Enterprise apps, select the app, set Assignment required? to Yes on its Properties page, and assign users or groups under Users and groups.
Open Applications → Applications → Create Application and choose Regular Web Application. Add the redirect URL to Allowed Callback URLs. Under Credentials, set Authentication Method to Client Secret (Post).
Copy Domain and the client ID and secret from Settings → Basic Information. The issuer is
https://<domain>/, including the trailing/. For a custom domain, use the issuer from that domain’s discovery document.In Google Cloud console, open Google Auth Platform → Clients → Create client and choose Web application. Add the redirect URL under Authorized redirect URIs, then copy the client ID and secret.
Use
https://accounts.google.comas the issuer, without a trailing/. To restrict sign-in to your Google Workspace organization, set the application’s audience to Internal. Keycard doesn’t check Workspace membership itself.Google shows the client secret only when you create it.
Open the environment your users sign in to, then Applications → Applications → + → OIDC Web App. Under Configuration, add the redirect URL and set Token Endpoint Authentication Method to Client Secret Post. Copy the client ID and secret.
Under Resources, allow
openid,profile, andemail. Under Attribute Mappings, addemailmapped to the person’s email address. Turn the application on.Copy the issuer from your environment’s discovery document. It has the form
https://auth.pingone.<tld>/<environment-id>/as; a custom domain useshttps://<custom-domain>/as.Use a provider that publishes OpenID Connect discovery at
<issuer>/.well-known/openid-configuration. Its web application must acceptclient_secret_post, allowopenid,profile, andemail, and includeemailin the ID token.Copy the exact
issuervalue from the discovery document. Keycard doesn’t use the UserInfo endpoint to retrieve email or sign users in over SAML. -
Add the provider to Keycard
In the same Zone, open Providers → Add Provider. Enter a name, the Issuer URL, Client ID, and Client Secret, then click Create Provider. Enter the Client ID and Client Secret even though Console marks them Optional; without them Keycard doesn’t use the application you registered.
Keycard ConsoleLocation: Providers → Add Provider (inside the Zone)Create provider
- Issuer URL *
- The OAuth issuer URL for your provider
<issuer-url>
- Client ID Optional
- OAuth 2.0 client identifier for your provider
<client-id>
- Client Secret Optional
- Optional for some providers, stored securely and encrypted by Keycard
<client-secret>
An asterisk marks a required field. Name and Description come before these fields, and Advanced options, closed at first, after them. The issuer must match the
issuervalue in the provider’s discovery document exactly, including any trailing/. -
Use the provider for Zone sign-in
Open Zone → Settings → Settings. Under Zone sign in configuration, select the provider you created in Identity Provider.
Keycard ConsoleLocation: Settings under Zone → Settings (inside the Zone)Zone configuration
Zone sign in configuration- Identity Provider
- Choose an identity provider to use for the zone sign in. Go to Providers
- Microsoft Entra IDExternal OAuth
Yours shows the Name you gave the Provider in step 3, with its logo and the External OAuth badge. The dropdown lists No Provider and this Zone’s Providers, including any for services such as Slack, so pick the one from step 3. If it isn’t listed, you created it in another Zone. Click Save Changes.
Verify user sign-in
Section titled “Verify user sign-in”- Connect a client to your protected server or application in the Zone.
- Sign in through your identity provider with the account you want to test. The client should finish connecting. If you’re already signed in, you may see consent screens instead: allow access on each.
- In Keycard Console, open People and confirm that account’s User appears in the Zone. A first sign-in creates the User unless your directory already provisioned it.
Your identity provider now authenticates users for this Zone. Your policies determine their access to its resources.
Use groups in policy (optional)
Section titled “Use groups in policy (optional)”To make access depend on directory membership, configure your provider to include a top-level groups claim in the ID token. The setup depends on your provider:
| Provider | Group configuration |
|---|---|
| Okta | On the application’s Sign On tab, add a Group claims filter named groups. Request the groups scope in Keycard for the org authorization server. For a custom authorization server, add a groups claim on the server: set Include in token type to ID Token and Always, and Include in to Any scope. Ensure its access policy includes this application, and don’t request the groups scope. |
| Microsoft Entra ID | Add a groups claim under Token configuration. Policies compare group object IDs, not names. Don’t request a groups scope. |
| PingOne | Under Attribute Mappings, map groups to Group Names. |
| Auth0 or Google | These integrations don’t supply the groups claim Keycard reads. Use Keycard Groups instead. |
When your provider requires a groups scope, open its Configuration → Advanced options in Keycard, add groups to Additional Scopes, and save.
Limit the claim to the groups your policies need. Okta’s org authorization server fails sign-in above 100 matching groups; Entra omits the claim above 200; PingOne replaces lists over 25 values with [SIZE_LIMIT_EXCEEDED].
A new Zone lets every signed-in person through by default, so a group rule changes access only in a Policy Set of your own. See Build a custom Policy Set.
Write a policy using context.subject_claims.groups, then use Run test to check the rule against the group values you expect.
Group changes don’t update existing authorizations immediately. Existing refresh tokens can retain earlier group values. To stop new credentials when access must end, disable the person in Keycard.
How identity claims and group changes reach policy
Keycard reads the ID token from your provider. It requests openid, profile, and email, plus the Provider’s Additional Scopes, and doesn’t call the provider’s UserInfo endpoint.
| Claim | How Keycard uses it |
|---|---|
iss and sub |
Recognize the provider account and link it to a User in the Zone. |
email |
Set the User’s email when sign-in creates the User, or link the sign-in to a User that directory sync created with the same email. Later sign-ins don’t update it. |
groups |
Store a snapshot of group membership with the sign-in session. |
| User Identifier Claim, if configured | Set the User’s identifier at creation, which becomes sub in Keycard-issued tokens. |
Policy receives context.subject_claims.email and context.subject_claims.groups. Other identity-provider claims don’t reach policy.
| Change | When it takes effect |
|---|---|
| Someone joins or leaves a group in your provider | In sessions that start after they next sign in to the Zone through your provider. |
| An agent was already authorized for them | The agent keeps the groups it got at authorization until its refresh token expires, up to 90 days later, even if the person signs in again. Revoking a grant doesn’t refresh them; to cut off access sooner, disable the person in Keycard. |
| Someone joins or leaves a Keycard Group, including one that directory sync fills | On the next request. Policy reads Keycard Groups every time it evaluates. |
| You disable the person in your provider | They can’t sign in again. Agents already authorized for them keep working until you disable the person in Keycard, or directory sync, if you use it, deactivates their User. |
Keycard Groups, including SCIM-synced groups, are read on every request. SCIM provisioning creates and updates directory records; it doesn’t sign users in.
A Keycard access token carries the User identifier and requested scopes, not email or groups. Policy allows or denies the requested scopes; Keycard doesn’t trim them to an allowed subset. See Token claims.
Troubleshoot sign-in
Section titled “Troubleshoot sign-in”No User Identity Provider configured in Zone
Your client reports invalid_request: No User Identity Provider configured in Zone. Select your provider in Zone → Settings → Settings → Identity Provider and save. If it isn’t listed, it belongs to another Zone. Switch to this Zone and create the Provider here.
Identity provider did not supply an email address
Configure the provider to include email in the ID token. In PingOne, add an email attribute mapping. In Entra, ensure the person’s account has an email address.
An account with this email already exists
The provider authenticated the person, but Keycard couldn’t create their User. Another User in the Zone, such as a disabled one, already has that email from the same provider, or the same identifier if you set a User Identifier Claim. Look up the account under People.
“This sign-in conflicts with an existing account” means the User is already linked to a different account at the same provider with that email. That can happen after an account is recreated, or after you replace a Microsoft Entra ID app registration, because Entra ID issues a different sub for each registration.
Next: control access by group
Section titled “Next: control access by group”Grant access by directory group shows how to use an Okta group to choose the Snowflake role an agent can use on someone’s behalf.