Agentic Token Exchange Flow

User to AI Agent Delegation using ID-JAG Tokens (client assertion)

Configuration
Flow Steps

Phase 1 — User Authentication

The user authenticates with Okta via the origin application. This produces an access token and/or ID token that represents the user's identity.

1
CLIENT APP

Obtain Access Token - User Authentication (SSO)

Using the OIDC standard authentication flow, redirect the user to Okta for authentication. The Agentic App exchanges the authorization code for an access token that will be used as the subject_token in token exchange.

Use Existing
Configuration
/oauth2/v1/
cURL Commands
1. Direct user to authorize endpoint for standard OAuth flow:

          
2. Exchange authorization code for tokens:

          
        
view log

Phase 2 — Agent Token Acquisition

The origin application sends the user's token to the AI Agent via a secure channel. The agent uses this token to obtain delegated authorization — first exchanging it for an ID-JAG token, then exchanging the ID-JAG for an access token from the custom authorization server.

2
AI Agent

Token Exchange - Obtain ID-JAG Token

The AI Agent exchanges the user's token for an ID-JAG (Identity Assertion) token via Token Exchange (RFC 8693). Uses a JWT client assertion signed with the Agent's private key for authentication.

Configuration
/oauth2/v1/
/oauth2/
Configure Audience (Target Auth Server) to load scopes
cURL Command

          
        
view log
3
AI Agent

JWT Bearer Grant - Obtain Access Token

The AI Agent exchanges the ID-JAG token for an access token from the Custom Authorization Server using the JWT Bearer grant (RFC 7523). Uses the same JWT client assertion for authentication.

Configuration
/oauth2/ /v1/
cURL Command

          
        
view log

Phase 3 — Use the Token

The AI Agent now has a scoped access token and can make API calls on behalf of the user.

4
AI Agent Optional

Test Token with API

Test the access token by making an authenticated API request to a resource server.

cURL Command

          
        
view log