Configure Login with ID-JAG
On this page
The Identity Assertion JWT Authorization Grant (ID-JAG) draft enables organizations to establish central policies for delegated cross-domain access in a user-friendly and automated way. Instead of running individual user-facing flows for each cross-domain access, the client obtains an ID-JAG from the user's identity provider (IdP) and presents it to the resource authorization server, which issues an access token for the API.
This tutorial explains how to configure the Curity Identity Server as the resource authorization server. It covers setting up a trusted issuer provider that allows for resolving trusted issuers for a client and tenant. It also covers how to enable and configure the assertion capability for ephemeral clients. For an overview of the ID-JAG flow, see SSO for AI Agents with OpenID Connect.
Beta version
The configuration below is based on an example using a beta build of the Curity Identity Server 11.7.0. It's a preview of what you can expect in version 11.7.0. Check feature availability and configuration against your version before using it. The feature is currently experimental and therefore subject to change.
Prerequisites
For this tutorial to work, you need the following:
- A running instance of the Curity Identity Server version 11.7.0 or later, with a token profile and ephemeral clients enabled.
- A trusted issuer provider that is an API reachable by the Curity Identity Server.
- An IdP or IdP authorization server that issues ID-JAGs for the Curity Identity Server.
- A client application like Claude that supports the ID-JAG flow (also known as MCP Enterprise Managed Authorization or auto-connect).
- An API like an MCP server to authorize requests based on access tokens from the Curity Identity Server.
Configuration Steps
To get an ID-JAG flow working requires configurations in multiple systems, the client, the IdP authorization server and the resource authorization server. In general the steps are as follows.
- If required, enable enterprise-managed authentication in MCP server. This enables the ID-JAG flow in the resource authorization server.
- Add the ID-JAG issuer ID as a trusted IdP in the resource authorization server (e.g., through an MCP server administration portal).
- Configure the IdP to issue ID-JAGs for the MCP server and client. For this you need to enter the resource authorization server's issuer ID and optionally an audience or tenant ID (
aud_tenant) that the IdP puts in the ID-JAG. - Wire up the client with the MCP server. Point the client, an AI agent, to the MCP server URL like
https://mcp.org.exampleand configure it to use enterprise-managed authentication.
This tutorial focuses on step 1 and 2. Refer to the documentation of your client provider and IdP, respectively, for guidance on the other steps.
Preparations
Before going through the tutorial, make sure you have the following details close at hand.
- The IdP's issuer identifier, often also referred to as issuer URL. This is the string that the IdP uses in the
issfield of the ID-JAG.- For OKTA, this is the OKTA tenant URL like
https://your-tenant-id.okta.com - For Claude-issued managed auth, the URL looks like
https://identity.anthropic.com/issuers/<issuer-id>whereissuer-idis unique for your organization.
- For OKTA, this is the OKTA tenant URL like
- JWKS URI of the IdP that holds the public keys required to verify the ID-JAG.
- Signature algorithm that the IdP uses for signing the ID-JAG, e.g.,
ES256 - Endpoint of the trusted issuer provider, like
https://tip.org.internal:8443that is reachable for the Curity Identity Server. - Audience value of the protected resource, e.g., the MCP endpoint like
https://mcp.org.example.
Understanding the Trusted Issuer Provider
This tutorial shows how to dynamically trust ID-JAG issuers with the Curity Identity Server by hosting a service that provides information on demand about a trusted issuer. This service is called the trusted issuer provider.
The Curity Identity Server queries the trusted issuer provider with a request similar to the following, where the client_id represents the client application the ID-JAG was issued for, the issuer holds the issuer identifier of the ID-JAG and audience the issuer identifier of the Curity Identity Server. Line breaks for readability.
GET /?client_id=https%3A%2F%2Fclaude.ai%2Foauth%2Fmcp-oauth-client-metadata%2Fconfidential_client&issuer=https%3A%2F%2Fidp.example.com&audience=https%3A%2F%2Flogin.org.exampleHost: tip.org.internal:8443Accept: application/json
The trusted issuer provider returns the data about the IdP that the Curity Identity Server needs for verifying an ID-JAG assertion.
This implies that the trusted issuer provider needs to be able to look up the IdP's issuer identifier and provide details about it, like the JWKS URI. Make sure to configure the trusted issuer provider accordingly. An empty response means there is no trusted issuer in this context, e.g., for the given issuer, client and tenant, and the Curity Identity Server will return an invalid_grant error.
The following snippet shows an example of a response of the trusted issuer provider:
[{"issuer": "https://idp.example.com","jwks_uri": "https://idp.example.com/jwks","attributes": {"": ""}}]
The specifics for how to implement a trusted issuer provider are out of scope of this tutorial. Refer to the Developer Guide for a detailed description of the API a trusted issuer provider must implement.
Enable JWT Assertion Grant
The ID-JAG is a profile of the JWT Assertion Grant. To have the Curity Identity Server accept JWT assertions as grant, you need to enable the grant at the token profile.
To enable the JWT assertion grant in the Admin UI, perform the following steps.
- Go to Profiles→Token Service
- In the left panel, navigate to General→Client Settings.
- Under the Capabilities, enable JWT Assertion as a supported grant.
- Make sure to add the IdP's signature algorithm for the ID-JAG to the list of allowed signature algorithms.
The following configuration is an example that enables the JWT assertion grant and allows RS256 and ES256 signature algorithms for it. Adapt the values according to your needs.
<config xmlns="http://tail-f.com/ns/config/1.0"><profiles xmlns="https://curity.se/ns/conf/base"><profile><id>token-service</id><type xmlns:as="https://curity.se/ns/conf/profile/oauth">as:oauth-service</type><settings><authorization-server xmlns="https://curity.se/ns/conf/profile/oauth"><client-capabilities><assertion><asymmetrically-signed-jwt><signature-algorithm>RS256</signature-algorithm><signature-algorithm>ES256</signature-algorithm></asymmetrically-signed-jwt></assertion></client-capabilities></authorization-server></settings></profile></profiles></config>
Review and commit the configuration changes. For instructions on merging partial XML without replacing the existing configuration, see Import and Export Configuration.
Add Trusted Issuer Providers
Configure the trusted issuer provider as a source of trusted issuer details.
The trusted issuer provider requires outbound calls from the Curity Identity Server. Create an HTTP client that the Curity Identity Server can use for these outbound calls.
- In the Admin UI, navigate to Facilities.
- Select HTTP Clients.
- Click on the plus button (+) in the menu to create a new HTTP Client.
- Enter a descriptive name for the HTTP Client, like
trusted-issuer-provider-http-client. - Select the scheme according to the trusted issuer endpoints, e.g.,
httpsto use HTTPS. - Configure the trust store if required.
- Adapt any remaining settings like the cache.
- Click done when done.
Next, add the trusted issuer provider as a source of trusted issuers for the ID-JAG (JWT assertion grant).
- Go back to the ID-JAG grant configuration.
- In the Admin UI, navigate to Profiles→Token Service→General→Client Settings→Capabilities.
- Locate the JWT Assertion in the list of capabilities.
- In the Trusted Issuer Providers section of the JWT Assertion capability, click the button + New Trusted Issuer Provider.
- Enter an ID for the provider.
- Provide the host and optionally a port of the trusted issuer provider. If the endpoint is
https://tip.org.internal:8443, entertip.org.internal:8443. - Select the HTTP client from above that the Curity Identity Server should use to connect to the provider. The HTTP client defines if the Curity Identity Server uses HTTP or HTTPS for the call.
- Optionally, select another HTTP client for the "Issuer HTTP Client." This is the HTTP client that the Curity Identity Server should use to resolve the keys of the issuer, i.e. for discovery or to load the JWKS URI.
- Commit the changes. Go to the Changes menu and select Commit.
If you don't specify an HTTP client, the Curity Identity Server uses its default HTTP client.
The Curity Identity Server is now set up to support ID-JAG. Next, you need to allow the grant for some clients.
The following XML config snippet represents the configuration of an HTTP client as well as a trusted issuer provider for the JWT assertion grant.
<config xmlns="http://tail-f.com/ns/config/1.0"><facilities xmlns="https://curity.se/ns/conf/base"><http><client><id>trusted-issuer-provider-http-client</id><scheme>https</scheme></client></http></facilities><profiles xmlns="https://curity.se/ns/conf/base"><profile><id>token-service</id><type xmlns:as="https://curity.se/ns/conf/profile/oauth">as:oauth-service</type><settings><authorization-server xmlns="https://curity.se/ns/conf/profile/oauth"><client-capabilities><assertion><trusted-issuer-provider><id>trusted-issuer-provider</id><webservice><hostname>tip.org.internal</hostname><port>8443</port><http-client>trusted-issuer-provider-http-client</http-client></webservice></trusted-issuer-provider></assertion></client-capabilities></authorization-server></settings></profile></profiles></config>
Replace the hostname, port and HTTP client settings with those for your provider. In production, make sure to secure the provider connection, restrict access to the provider and protect its configuration: its response determines which issuers and keys the authorization server trusts.
Enable ID-JAGs for Ephemeral Clients
ID-JAG is only supported for confidential clients. If not yet configured, enable Asymmetrically Signed JWT as an allowed client authentication method for ephemeral clients. Then configure the JWT assertion grant (and thus ID-JAG) for ephemeral clients.
- Go to Profiles→Token Service→General→Ephemeral Clients
- In the Client Authentication section, enable the toggle for Asymmetrically Signed JWT. This allows CIMD clients to authenticate using
private_key_jwt. - Locate the Capabilities section on the page.
- Enable the toggle for JWT Assertion.
- In the drop down for the Trust Source select
Trusted issuer provider. - In the field for the Trusted Issuer Provider select the
trusted-issuer-providerto point to the trusted issuer provider created above. - Commit the changes. In the Changes menu click Commit.
The following config is an example for client authentication with private_key_jwt and ID-JAG for ephemeral clients using a trusted issuer provider to retrieve details about a trusted issuer.
<config xmlns="http://tail-f.com/ns/config/1.0"><profiles xmlns="https://curity.se/ns/conf/base"><profile><id>token-service</id><type xmlns:as="https://curity.se/ns/conf/profile/oauth">as:oauth-service</type><settings><authorization-server xmlns="https://curity.se/ns/conf/profile/oauth"><client-authentication><asymmetrically-signed-jwt><signature-algorithm>RS256</signature-algorithm><signature-algorithm>ES256</signature-algorithm></asymmetrically-signed-jwt></client-authentication><ephemeral-client><capabilities><assertion><jwt><trust><trusted-issuers-from-provider>trusted-issuer-provider</trusted-issuers-from-provider></trust></jwt></assertion></capabilities><client-authentication-method><asymmetrically-signed-jwt><signature-algorithms><all/></signature-algorithms></asymmetrically-signed-jwt></client-authentication-method></ephemeral-client></authorization-server></settings></profile></profiles></config>
The allowed client authentication algorithms are configured separately from the allowed ID-JAG signing algorithms. In this example, ephemeral clients can use any of the client authentication algorithms enabled at the profile level. Restrict ephemeral client IDs and scopes to those needed by your deployment.
The Curity Identity Server now supports ID-JAG for ephemeral clients and retrieves the trusted issuer details on demand from a trusted issuer provider.
Accessing ID-JAG Claims
You can access the claims of the ID-JAG and the attributes from the trusted issuer provider in token procedures. The Curity Identity Server places them in the context attributes. Study the following token procedure example:
function result(context) {var delegationData = context.getDefaultDelegationData();var issuedDelegation = context.delegationIssuer.issue(delegationData);var accessTokenData = context.getDefaultAccessTokenData();// ID-JAG specific processingif (context.contextAttributes().assertion_type === 'id-jag') {accessTokenData.aud_tenant = context.contextAttributes().aud_tenant; // aud_tenant comes from ID-JAGvar tenantAttributes = context.contextAttributes().trusted_issuer_attributes // attributes from the trusted issuer providerif (tenantAttributes) {accessTokenData.tenant = tenantAttributes; // parse and process attributes}}var issuedAccessToken = context.accessTokenIssuer.issue(accessTokenData, issuedDelegation);return {scope: accessTokenData.scope,access_token: issuedAccessToken,token_type: 'bearer',expires_in: secondsUntil(accessTokenData.exp)};}
Test the Grant
Authenticate a user with the IdP, then use its token exchange endpoint to request an ID-JAG for the resource authorization server's issuer identifier. Supply the target resource and scopes according to the IdP's requirements. The client then sends the ID-JAG to the Curity Identity Server's token endpoint using the JWT bearer grant (JWT assertion grant). Line breaks in the form body below are for readability.
POST /oauth/v2/oauth-token HTTP/1.1Host: login.org.exampleContent-Type: application/x-www-form-urlencodedgrant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=<url-encoded-ID-JAG>&scope=read&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer&client_assertion=<url-encoded-client-authentication-JWT>
This example uses private_key_jwt for client authentication where the client provides a self-signed JWT in the client_assertion parameter. The assertion holds the IdP-issued ID-JAG. A registered client using another configured authentication method must authenticate accordingly instead. Adapt the token endpoint and URL-encode all form values.
On success, the response contains an access token. Send that access token, not the ID-JAG, to the API or MCP Server and verify that it permits the intended operation. Also verify that an assertion from an untrusted issuer, for the wrong authorization server or client, or requesting unauthorized access is rejected. Do not log assertions, client credentials or access tokens.
Troubleshooting
- Trust or signature failure: Check the provider response, exact issuer, client_id, audience, reachable JWKS URI, signing key and permitted assertion algorithms.
- Audience or client mismatch: Check that the ID-JAG targets the resource authorization server and identifies the client registered there. These values may differ from the IdP-side client ID and the token endpoint URL.
- Client authentication failure: Check the client's authentication method, signing key and allowed client authentication algorithms. For an ephemeral client, check its metadata document and JWKS URI.
- Scope failure: Check the IdP's grant policy, the requested scope and the scopes allowed for the client at the resource authorization server.
The JWT Assertions guide describes the general JWT bearer grant. When enabling the JWT assertion grant, the Curity Identity Server also enables support for ID-JAG.
Customer Stories
Learn how organizations run identity and API security at scale.
Read customer storiesWas this helpful?