Allows users to manage delegated access to third-party OAuth2 services:
View their user information
List agents they have granted access to
Review detailed agent information and available services
View and manage grants for specific agents
Grant, update, or revoke delegated access to third-party services
View third-party services with OAuth2 session status
Initiate OAuth2 authorization flows with third-party services (GitHub, Google, etc.)
Terminate OAuth2 sessions and view affected agents
Implements RFC 6749 (OAuth2) and RFC 8414 (OAuth2 Server Metadata) for delegated authorization code flow:
All API endpoints (except /health, /.well-known/oauth-authorization-server, and the public /.well-known/oauth-client/{service-id} documents) require authentication via:
Pre-authentication: Reverse proxy (e.g., oauth2-proxy, nginx) validates the user
Principal Header: Principal extracted from X-Remote-User header (configurable)
Session Cookie: Session-based authentication established after pre-auth
The X-Remote-User header is set by the upstream authentication proxy and contains
the user's principal identifier (typically email address or UUID).
CORS is enabled for all /api/* routes on the end-user server to support browser-based
single-page applications. OAuth2 endpoints are also publicly accessible as required by RFC 6749.
Success responses: Most endpoints wrap data in a {"data": ...} envelope
Error responses: Follow format {"error": "code", "message": "description"}
OAuth2 responses: Follow RFC 6749 format (no data envelope)
Date/Time format: ISO 8601 (RFC3339) format, e.g., 2025-12-19T10:30:00Z
This API follows the Zalando RESTful API Guidelines with emphasis on:
Resource-oriented design
Consistent error handling
Clear HTTP status code semantics
Comprehensive validation messages
By default, every HTTP response from this API includes the additive W3C
traceresponse response header.
<trace-id> field is the request correlation identifier operators can use to find matching logs.request_context.trace.response_enabled.Returns the current health status of the end-user HTTP server.
This endpoint does not require authentication and is intended for:
Status Codes:
200 OK: Server is healthy and accepting requests503 Service Unavailable: Server is starting, shutting down, or unhealthyHealth States:
healthy: Server is operational and processing requests normallystarting: Server is initializing (binding to port, setting up routes)shutting_down: Graceful shutdown in progress, completing in-flight requestsunhealthy: Server encountered an error and requires restartThe response may also include component-level health in components. Components report
healthy or degraded and never change the HTTP status or the top-level status.
upstream_jwks (proxy and hybrid modes): freshness of the upstream key set that the broker
republishes.trust_anchor_key_files (any mode, when a trust anchor uses jwks_file): degraded when the
latest re-read of any key-set file failed. The broker keeps verifying with the last valid key set
until that trust anchor's maximum refresh interval expires.{- "status": "healthy",
- "timestamp": "2025-12-19T10:30:00Z",
- "uptime_seconds": 3600
}Returns information about the currently authenticated user.
The user information includes:
The principal is extracted from the X-Remote-User header set by the upstream authentication proxy (oauth2-proxy, nginx, etc.).
Use Cases:
{- "data": {
- "principal": "user@example.com",
- "displayName": "Jane Doe",
}
}Returns a list of all agents to which the current user has granted access.
Each agent delegation includes:
Response Characteristics:
Use Cases:
{- "data": [
- {
- "agentId": "550e8400-e29b-41d4-a716-446655440000",
- "displayName": "Data Analysis Assistant",
- "activeGrantCount": 3,
- "lastModifiedAt": "2025-12-17T14:30:00Z",
- "expiresAt": null
}, - {
- "agentId": "660e8400-e29b-41d4-a716-446655440001",
- "displayName": "Document Processor",
- "activeGrantCount": 2,
- "lastModifiedAt": "2025-12-16T09:15:00Z",
- "expiresAt": "2026-01-15T00:00:00Z"
}
]
}Returns detailed information about a specific agent and all available third-party OAuth2 services that can be delegated to that agent.
Agent Detail Includes:
Service Information Includes:
require_all_scopes requirement, this is the sorted, deduplicated union from this agent's assigned Permission Sets that cover that service.Use Cases:
| agent-id required | string <uuid> Example: 550e8400-e29b-41d4-a716-446655440000 Unique agent identifier (UUID format). The agent ID identifies a specific agent in the system. Agents are registered in the identity broker and represent AI assistants or automated systems that require delegated access to user resources. |
| session_token | string non-empty Example: session_token=eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0... JWE authorization session token for all agent modes (local, proxy, CIMD). When present, the response includes authorization context extracted from the decrypted token (agent_id, principal, original_url). For CIMD agents, also includes CIMD metadata (client_id_url, redirect_uri, verified_domain, requested_scopes, logo_uri). Present whenever the user arrived via an OAuth2 authorization redirect. |
{- "data": {
- "agent": {
- "agentId": "550e8400-e29b-41d4-a716-446655440000",
- "displayName": "Data Analysis Assistant",
- "description": "Analyzes datasets and generates insights using advanced algorithms",
}, - "services": [
- {
- "serviceId": "11111111-1111-1111-1111-111111111111",
- "serviceName": "Google Drive",
- "requirementType": "mandatory",
- "requiredScopes": [
- {
- "name": "read:files",
- "description": "Read files from your Google Drive"
}, - {
- "name": "write:files",
- "description": "Create and update files in your Google Drive"
}
], - "connectionStatus": "connected"
}, - {
- "serviceId": "22222222-2222-2222-2222-222222222222",
- "serviceName": "GitHub",
- "requirementType": "optional",
- "requiredScopes": [
- {
- "name": "read:repos",
- "description": "Read access to repositories"
}, - {
- "name": "write:repos",
- "description": "Write access to repositories"
}
], - "connectionStatus": "not_connected"
}
]
}
}Returns all active grants the authenticated user has granted to the specified agent.
Grant Information Includes:
Response Characteristics:
Use Cases:
| agent-id required | string <uuid> Example: 550e8400-e29b-41d4-a716-446655440000 Unique agent identifier (UUID format). The agent ID identifies a specific agent in the system. Agents are registered in the identity broker and represent AI assistants or automated systems that require delegated access to user resources. |
{- "data": [
- {
- "id": "770e8400-e29b-41d4-a716-446655440002",
- "principal": "user@example.com",
- "agent_id": "550e8400-e29b-41d4-a716-446655440000",
- "valid_until": "2026-06-01T00:00:00Z",
- "granted_permission_sets": {
- "770e8400-e29b-41d4-a716-446655440001": [
- "880e8400-e29b-41d4-a716-446655440010",
- "880e8400-e29b-41d4-a716-446655440011"
], - "770e8400-e29b-41d4-a716-446655440002": [
- "880e8400-e29b-41d4-a716-446655440012"
]
}, - "created_at": "2025-12-18T10:00:00Z",
- "updated_at": "2025-12-18T10:00:00Z"
}
]
}Creates a new grant or updates an existing grant for the specified agent.
Upsert Semantics:
One grant per user-agent pair
Subsequent POSTs update the existing grant
Previous granted permission sets are replaced (not merged)
Grant Expiration:
valid_until is optional (omit for indefinite grant)Revocation (Special Case):
Submit empty granted_permission_sets object to revoke
Returns 204 No Content on successful revocation
Deletes the grant entirely
Session-Based Consent (FR-029):
session_token query parameter to resume an OAuth2 authorization flow after consentredirect_url field containing the original authorization URL (with original state, redirect_uri, PKCE, and client_id parameters intact)redirect_url using window.location.href to resume the OAuth2 flow400 Bad Request with error code session_expired if the token is invalid or expired400 Bad Request if the session agent does not match the agent in the URL path403 Forbidden if the session principal does not match the authenticated userStandalone Consent Management:
session_token are treated as direct consent-management operations (not authorization resumption)redirect_url field)Validation:
400 Bad Request with details if validation failsUse Cases:
| agent-id required | string <uuid> Example: 550e8400-e29b-41d4-a716-446655440000 Unique agent identifier (UUID format). The agent ID identifies a specific agent in the system. Agents are registered in the identity broker and represent AI assistants or automated systems that require delegated access to user resources. |
| session_token | string JWE authorization session token (FR-029). When present, the grant endpoint decrypts the token to resolve the redirect target. Returns 400 if the token is invalid or expired; 400 if the session agent does not match the requested agent; 403 if the session principal does not match the authenticated caller. |
Grant request with delegated services and optional expiration
required | object Map of permission sets to grant to the agent. Keys are permission set UUIDs, values are arrays of service UUIDs included in each permission set grant. Special Case: Empty object
|
| valid_until | string or null <date-time> Optional grant expiration (ISO 8601 format). Validation:
Behavior:
|
{- "granted_permission_sets": {
- "770e8400-e29b-41d4-a716-446655440001": [
- "880e8400-e29b-41d4-a716-446655440010",
- "880e8400-e29b-41d4-a716-446655440011"
], - "770e8400-e29b-41d4-a716-446655440002": [
- "880e8400-e29b-41d4-a716-446655440012"
]
}
}{- "data": {
- "id": "770e8400-e29b-41d4-a716-446655440002",
- "principal": "user@example.com",
- "agent_id": "550e8400-e29b-41d4-a716-446655440000",
- "valid_until": null,
- "granted_permission_sets": {
- "770e8400-e29b-41d4-a716-446655440001": [
- "880e8400-e29b-41d4-a716-446655440010",
- "880e8400-e29b-41d4-a716-446655440011"
], - "770e8400-e29b-41d4-a716-446655440002": [
- "880e8400-e29b-41d4-a716-446655440012"
]
}, - "created_at": "2025-12-19T10:00:00Z",
- "updated_at": "2025-12-19T10:00:00Z"
}
}Permanently deletes the authenticated user's grant for the specified agent. After revocation, the agent can no longer perform token exchanges on behalf of the user.
Important: This action only removes the delegation grant. Connected OAuth2 sessions (e.g., GitHub, Google) remain active and are NOT terminated by this action. Users may manage OAuth2 sessions separately.
Idempotency: Non-idempotent — returns 404 if no grant exists. To silently
revoke if a grant exists, use POST /api/consent/agents/{agent-id}/grants with
an empty granted_permission_sets object.
Security: Only the grant owner may revoke. The principal is derived from the
X-Remote-User authentication header. Cross-user revocation is not possible —
grants are scoped to the authenticated principal.
| agent-id required | string <uuid> Example: 550e8400-e29b-41d4-a716-446655440000 Unique agent identifier (UUID format). The agent ID identifies a specific agent in the system. Agents are registered in the identity broker and represent AI assistants or automated systems that require delegated access to user resources. |
{- "error": "bad request",
- "message": "agent ID is required"
}Initiates an OAuth2 authorization code flow. The broker validates the agent, checks consent, and either redirects to the upstream OAuth2 authorization server or issues an authorization code directly (local/hybrid mode).
client_id semantics:
In proxy mode the client_id MUST be the agent's internal UUID (agent.id).
In local/hybrid mode the client_id may also be an HTTPS URL identifying a
Client ID Metadata Document (CIMD) when CIMD is enabled.
redirect_uri validation (all modes):
redirect_uri is matched against the agent's redirect_uris. For a CIMD client_id, it is matched against the fetched document's redirect_uris.http URIs match on any port.github-app://oauth/callback matches only character for character. For a CIMD client, the agent's redirect_uris must also list it.redirect_uri.Local/Hybrid Mode: When the broker acts as its own OAuth2 authorization server:
redirect_uri with code and statecode_challenge and code_challenge_methodProxy Mode: When proxying to an upstream OAuth2 server:
Error Handling (RFC 6749 §4.1.2.1):
Direct JSON responses (no redirect — RFC 6749 §4.1.2.1):
invalid_client (400): client_id is not a valid UUID OR no agent with that UUID exists; a retrieved CIMD document is malformed or violates policy, including an unallowlisted private-use redirect URIinvalid_redirect_uri (400): redirect_uri not registered on the agentinvalid_request (400): Missing PKCE parameters, or redirect_uri not registered for a CIMD clientunsupported_response_type (400): response_type is not codeserver_error (500): Internal infrastructure failure, or a CIMD metadata document cannot be retrieved because of a timeout, connection failure, or upstream server errorRedirect responses (error appended to redirect_uri as query params; redirect_uri has been validated):
invalid_scope: Requested scope exceeds the agent's allowed_scopesaccess_denied: User explicitly denied consentserver_error: Proxy mode — agent has no upstream client_id configured| client_id required | string Example: client_id=a1b2c3d4-e5f6-7890-abcd-ef1234567890 In proxy mode, use the registered agent UUID. In local or hybrid mode, use either the registered agent UUID or, when CIMD is enabled, its pre-registered HTTPS Client ID Metadata Document URL. This is not the upstream OAuth2 |
| response_type required | string Value: "code" OAuth2 response type. Must be "code" for authorization code flow. |
| redirect_uri required | string <uri> Callback URI to redirect to after authorization. Must be pre-registered: an https URI, a loopback http URI, or an allowlisted native-app private-use scheme URI (see redirect_uri validation). |
| state | string Opaque value used to maintain state between request and callback (CSRF protection). |
| scope | string Space-delimited list of requested OAuth2 scopes. |
| code_challenge | string PKCE code challenge (RFC 7636). SHA256 hash of code_verifier, base64url-encoded. |
| code_challenge_method | string Value: "S256" PKCE code challenge method. Must be "S256". |
{- "error": "invalid_client",
- "error_description": "Client not registered"
}Exchange a token for another token, or obtain a token directly. This endpoint supports three grant types:
Authenticate the agent directly using broker-issued client credentials and obtain an access token. Used when the broker acts as an OAuth2 authorization server.
grant_type: client_credentialsclient_id: Agent UUID (agent.id)client_secret: Broker-issued client secretscope: (optional) Space-delimited requested scopesExchange an authorization code for an access token. Supports PKCE for public clients.
grant_type: authorization_codeclient_id: Agent UUID (agent.id)client_secret: Broker-issued client secretcode: Authorization code from /oauth2/authorizeredirect_uri: Must match the URI used in the authorization requestcode_verifier: (optional) PKCE code verifier (RFC 7636)private_key_jwt)In local or hybrid mode with CIMD enabled, a pre-registered CIMD client may declare
token_endpoint_auth_method: private_key_jwt. For authorization_code and
refresh_token requests, it must send client_assertion_type and a signed
client_assertion. The assertion must use a key published by the client, identify
the client in iss and sub, target the broker issuer or canonical token endpoint,
and include an unexpired, single-use jti. Authorization-code exchange still requires
the registered redirect_uri and PKCE S256 verifier. A client secret or Authorization
header must not accompany the assertion. Assertion failures return invalid_client;
malformed assertion parameters return invalid_request; key-set or metadata fetch
failures return server_error. Failed authentication does not consume the code or rotate
a refresh token.
Exchange an authorization code for an access token via the upstream OAuth2 server.
This is the standard OAuth2 authorization code flow used for initial user consent. The
broker forwards form fields, including client_secret when supplied, in the request body
and forwards only the validated form Content-Type request header. It does not forward
credential headers such as Authorization, cookies, or proxy identity headers. The broker
returns only Content-Type, Cache-Control, Pragma, and WWW-Authenticate from upstream
responses. It never returns upstream cookies or arbitrary response headers.
Exchange a token issued by the Upstream OAuth2 Server for a third-party OAuth2 token stored in the token vault.
Third-party exchange requires the exact subject_token_type
urn:ietf:params:oauth:token-type:access_token and client_assertion_type
urn:ietf:params:oauth:client-assertion-type:jwt-bearer. Missing, empty, or different
identifiers return 400 invalid_request; the broker does not supply defaults.
All token grants require exactly one Content-Type field. Per RFC 6749 Section 3.2, a
parameter sent without a value is treated as omitted. A singleton form parameter with
more than one non-empty value returns 400 invalid_request. These parameters are
grant_type, client_id, client_secret, code, redirect_uri, refresh_token,
code_verifier, scope, subject_token, subject_token_type, client_assertion,
client_assertion_type, actor_token, actor_token_type, and requested_token_type.
The resource and audience parameters are repeatable under RFC 8693 Section 2.1.
Repeated resource values that normalize to the same URI are accepted. Distinct
resource values return 400 invalid_target because the broker returns one service
token.
The token exchange flow:
Authentication for Token Exchange:
Resource Discovery:
server_error.User Grant Verification:
access_denied with
error_uri set to the agent consent-management page
(<public URL>/agents/{agent-id}). This includes empty grants, uncovered services,
and undeclared or removed permission sets. The broker denies before any token-vault lookup.Session Recovery:
invalid_grant. Its
error_uri starts authorization for the resolved service at
<public URL>/api/third-party/{service-id}/oauth2/authorize with an encoded
<public URL>/sessions return URI.invalid_grant, the broker returns 400 invalid_grant with the same
service-specific error_uri. The stored tokens are left unchanged, and the rejection is
recorded. Later exchanges return the same error without contacting the provider, even
while the stored access token has not expired, until the user reconnects the service.invalid_grant with the same service-specific error_uri.
The broker stops before provider authentication and leaves the established session unchanged.invalid_client, a provider 5xx,
an unparseable provider response, or a transport, storage, or decryption failure)
returns 500 server_error without error_uri. Provider error descriptions are never
returned.invalid_grant; invalid client assertions
return 401 invalid_client. Neither is a provider-session recovery request.error and the optional error_uri to choose the recovery flow.Mints a locally issued access token representing a subject user and attributing the acting
party with the standard act claim. Available only in local mode; proxy and hybrid
reject it.
The routing-only oauth2_authorization_server.impersonation.audience_prefix activates
impersonation only when exactly one request audience is
<audience_prefix>/<canonical lower-case AgentID UUID or canonical_id>. Both forms resolve
the same registered target agent, which supplies minted UUID agent_id and local-token CEL
agent.*. A signed client assertion is the privileged-client identity for authorization and
audit only. The routing audience is never copied into issued aud; the existing local
token_claims_expression emits aud or leaves it absent exactly as normal local issuance
does. Activation precedes the third-party mandatory-resource check.
grant_type: urn:ietf:params:oauth:grant-type:token-exchangeaudience: one <audience_prefix>/<canonical lower-case AgentID UUID or canonical_id> URIclient_assertion_type: urn:ietf:params:oauth:client-assertion-type:jwt-bearerclient_assertion: signed JWT authenticating the privileged clientactor_token_type: urn:ietf:params:oauth:token-type:jwtactor_token: signed JWT identifying the actorsubject_token_type: urn:ietf:params:oauth:token-type:jwt; a matching rule's
verification: none selects the unsigned-subject profilesubject_token: signed subject JWT, or, for a matching verification: none rule, an
unsigned alg:none JWTrequested_token_type: optional; when present MUST equal the access-token typeresource is rejected with invalid_request. An optional scope requests values from the
resolved target agent's allowed_scopes; an empty target allow-list is unrestricted, and
offline and offline_access are always permitted refresh-token scopes. An out-of-list
non-reserved value returns invalid_scope. The normal local JWT and response carry non-empty granted scope.
Signed credentials are validated for signature, issuer, audience, expiry, and not-before
before a CEL authorization predicate decides the request. Bare suffixes and suffixes matching
neither identifier form return invalid_request; a well-formed UUID or canonical-ID suffix
whose target is unknown returns invalid_target.
No-match precedence is access_denied > invalid_request > invalid_client.
After a rule authorizes a human-category request, the broker requires an active user
delegation for the extracted subject and target agent. A missing or expired delegation returns 403 access_denied
with the existing RFC 6749 error_uri response member set to the authenticated user's
target-agent consent page. The response intentionally does not distinguish a missing delegation
from an expired one. An unverified subject has no exemption; a delegation lookup failure returns
500 server_error without error_uri.
Each impersonation rule lists accepted allowed_subject_categories: human, agent,
or both. Omission means [human]. No request parameter selects the category. A request
is agent-category only when the rule's subject role is signed, its credential verifies,
and its raw string sub is byte-for-byte equal to the canonical UUID of the target
selected by audience. Every other request is human-category, including every unsigned
(verification: none) subject. Aliases, display names, other agents' UUIDs and different
UUID spelling do not qualify. All configured principal extractions must still succeed;
an eligible agent's represented subject is the target UUID, not necessarily the extracted principal.
A category-ineligible rule falls through. No match returns the existing generic
403 access_denied (impersonation not permitted) without error_uri. Signed exact
equality on human-only or omitted-category rules is ineligible even with active same-text
human delegation. Eligible, CEL-authorized agents need no delegation, never return a
consent-required error_uri, and create no grant or session. Human delegation denials
remain terminal and are never retried as agents.
Agent tokens have reserved sub and agent_id equal to the target UUID and existing
act (iss: verified actor issuer, sub: extracted actor). No category claim is added.
token_claims_expression cannot override those reserved identities. Subject email
extraction is not evaluated and no credential-derived email is supplied; output email
remains policy-owned. Issuer, signing, lifetime, scope and audience policy are unchanged.
After validating credentials and extracting the principal, before agent-ID extraction,
authorization, resources, grants or sessions, third-party exchange evaluates
token_exchange.claim_extraction.agent_subject_expression. Its guarded default is
has(subject_token.sub) && has(subject_token.agent_id) && subject_token.sub == subject_token.agent_id.
A match returns 403 access_denied with description
agent-subject tokens cannot be exchanged for third-party service tokens, no error_uri,
and no human grant, session or provider access, including same-text human state.
Default detection also rejects equal-claim legacy, mapped/unsigned human and trusted
external issuer tokens. An evaluation error, timeout or dynamic non-boolean output
returns 500 server_error without consent recovery or human-state access, never false.
A configured expression replaces the default entirely, with no additional built-in check.
It must reference subject_token.sub; otherwise the broker refuses to start, so false
cannot be configured. Operators must retain broker agent-token matching, for example by
preserving the default as a disjunct. A non-matching result continues existing checks,
which may read matching human grants/sessions and return consent errors. Such overrides
remove categorical rejection and same-text human-credential isolation.
Form-encoded request bodies larger than 256 KiB are rejected with the documented HTTP 400 invalid_request response before token-form parsing.
| grant_type required | string Enum: "urn:ietf:params:oauth:grant-type:token-exchange" "authorization_code" "client_credentials" "refresh_token" The OAuth2 grant type:
|
| client_id | string In proxy mode: the agent's internal UUID ( |
| client_secret | string Broker-issued client secret (for client_credentials in local/hybrid mode, and for confidential-client authorization_code exchanges) or upstream OAuth2 client secret (proxy mode). Optional for public authorization_code clients in local/hybrid mode. |
| code | string Authorization code received from the /oauth2/authorize endpoint. Required for authorization_code grant type. |
| redirect_uri | string <uri> Redirect URI used in the original authorization request. Required for authorization_code grant type. Must match the URI used in the authorization request exactly. |
| code_verifier | string PKCE code verifier (RFC 7636). Required if code_challenge was provided in the authorization request. |
| subject_token | string For third-party token exchange, a JWT from which the broker extracts the user
principal and agent identifier. For user impersonation, a signed subject JWT or,
only when a matching rule declares |
| subject_token_type | string Type of the subject_token.
|
| actor_token | string Signed JWT identifying the acting party for user impersonation. Required for the
impersonation flow. Its validated issuer and extracted identity surface as
|
| actor_token_type | string Value: "urn:ietf:params:oauth:token-type:jwt" Type of the actor_token. MUST be the RFC 8693 JWT token type. Required for the impersonation flow. |
| requested_token_type | string Value: "urn:ietf:params:oauth:token-type:access_token" Optional for the impersonation flow. When present it MUST equal the access-token
type; any other value is rejected with |
| resource | string <uri> Required for third-party token exchange. It must match a protected_resource on a ThirdpartyOAuth2Service and is normalized by removing trailing slashes before matching. It MUST be absent for audience-activated user impersonation. |
| client_assertion_type | string Value: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer" JWT bearer assertion type. Required with client_assertion for RFC 8693 token exchange, user impersonation, and CIMD private_key_jwt authorization-code or refresh-token grants. |
| client_assertion | string Signed JWT. For third-party token exchange it authenticates the privileged client against the configured client-assertion issuer; user impersonation validates it against a trusted issuer in the matching impersonation rule. For a CIMD client that declares private_key_jwt, it authenticates the client at authorization-code and refresh-token grants using a public key from the client's metadata document. |
| scope | string Optional literal-space-separated scope request. For user impersonation, every non-reserved value must be permitted by the resolved target agent's |
| audience | string <uri> Optional token-exchange audience. For local impersonation it must be exactly one
|
grant_type=client_credentials&client_id=550e8400-e29b-41d4-a716-446655440000&client_secret=brk_sec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6&scope=openid%20profile
{- "access_token": "ghu_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
- "token_type": "Bearer",
- "issued_token_type": "urn:ietf:params:oauth:token-type:access_token",
- "expires_in": 3600
}Returns the broker's aggregated public signing keys in JWK Set format (RFC 7517). It does not publish CIMD client-authentication keys.
Clients use this single endpoint to verify any token the broker asks them to trust, regardless of operating mode. Only public key material is included — private keys are never exposed.
Mode-dependent content:
local mode: returns only the broker's locally-generated signing keys.proxy mode: republishes the upstream authorization server's public keys verbatim.hybrid mode: returns the union of local signing keys and upstream keys in a
single JWKS document. If any kid appears in both sets, the endpoint returns 500.Availability: Served in all three modes (local, proxy, hybrid). Returns
503 if the upstream JWKS is unavailable (proxy/hybrid modes). Returns 500 if a
duplicate kid is detected across local and upstream key sets (hybrid mode).
Caching: Successful responses include Cache-Control: public, max-age=300.
After a signing-key removal commits, a direct request beginning on any broker
replica omits the key or returns an error if the key-set revision cannot be
checked. Requests already in flight may still return an earlier snapshot.
Previously fetched responses can remain in verifier or intermediary caches;
the broker cannot enforce a third-party verification deadline.
Key Rotation: Newly stored keys are available on the next direct JWKS request. Previous keys remain in the broker's set until removed by an admin.
{- "keys": [
- {
- "kty": "EC",
- "crv": "P-256",
- "kid": "key-2025-12-19-001",
- "use": "sig",
- "alg": "ES256",
- "x": "f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU",
- "y": "x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0"
}
]
}Returns the public Client ID Metadata Document for a CIMD confidential or CIMD public service.
The returned client_id exactly equals this retrieval URL. The document uses
the end-user public URL as its base and contains no private key material or secrets.
A CIMD public service returns the document without a CIMD client-authentication key.
Its document has no jwks_uri or token_endpoint_auth_signing_alg.
| service-id required | string <uuid> Immutable service UUID. |
{- "grant_types": [
- "authorization_code",
- "refresh_token"
], - "response_types": [
- "code"
], - "token_endpoint_auth_method": "private_key_jwt",
- "token_endpoint_auth_signing_alg": "ES256",
}Returns the public ES256 client-authentication keys for a CIMD confidential service.
A CIMD public service returns the uniform JSON 404, even without a CIMD client-authentication key.
Keys come only from the cimd_client_authentication domain. The set can include
a generated key during its activation grace period and retains non-current keys
until an operator removes them. It never includes token-signing keys, upstream
keys, private JWK members, encrypted key material, or secrets.
| service-id required | string <uuid> Immutable service UUID. |
{- "keys": [
- {
- "kty": "EC",
- "crv": "P-256",
- "kid": "cimd-client-authentication-key-2026-09-21-001",
- "use": "sig",
- "alg": "ES256",
- "x": "f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU",
- "y": "x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0"
}
]
}Returns the broker's OAuth2 authorization server metadata as defined in RFC 8414. This enables dynamic client discovery of the broker's OAuth2 capabilities and endpoints.
Mode-specific behavior:
proxy mode: issuer is the broker's own public URL. jwks_uri points to the
broker's /oauth2/jwks.json endpoint, which republishes upstream keys.local mode: issuer is the broker's own public URL. jwks_uri points to the
broker's /oauth2/jwks.json endpoint, which serves locally-generated signing keys.hybrid mode: issuer is the broker's public URL. jwks_uri points to the
broker's /oauth2/jwks.json endpoint (union of local and upstream keys). The
metadata reflects the union of capabilities for both proxy and local grant types.Caching: Responses include Cache-Control: public, max-age=3600 to allow
clients to cache metadata for 1 hour.
No Authentication: This endpoint is publicly accessible as required by RFC 8414.
{- "response_types_supported": [
- "code"
], - "grant_types_supported": [
- "authorization_code",
- "client_credentials",
- "urn:ietf:params:oauth:grant-type:token-exchange"
], - "token_endpoint_auth_methods_supported": [
- "none",
- "client_secret_post",
- "private_key_jwt"
], - "token_endpoint_auth_signing_alg_values_supported": [
- "RS256",
- "ES256"
], - "code_challenge_methods_supported": [
- "S256"
], - "scopes_supported": [
- "openid",
- "profile",
- "email"
]
}Returns one summary for each third-party OAuth2 session of the authenticated user. Services without a session are not listed.
Each summary includes:
{- "data": {
- "sessions": [
- {
- "id": "660e8400-e29b-41d4-a716-446655440001",
- "service_id": "550e8400-e29b-41d4-a716-446655440000",
- "service_display_name": "GitHub",
- "token_type": "Bearer",
- "scope": [
- "repo",
- "user:email"
], - "initiated_at": "2025-12-20T10:30:00Z",
- "requires_reauthentication": false,
- "is_expired": false,
- "access_token_expired": false,
- "has_refresh_token": true,
- "dependent_agent_count": 3,
- "is_encrypted": true
}
]
}
}Starts third-party OAuth2 authorization for the specified service with PKCE.
It redirects the browser to that service's provider, not the broker's
/oauth2/authorize endpoint. A successful provider callback returns
to the validated redirect_uri. RFC 8693 recoverable session errors
link to this GET with redirect_uri set to the configured public URL's
/sessions page. For example:
https://broker.example.com/api/third-party/550e8400-e29b-41d4-a716-446655440000/oauth2/authorize?redirect_uri=https%3A%2F%2Fbroker.example.com%2Fsessions.
The broker seals the principal, PKCE verifier, service ID, and return URI in JWE state. The return URI must have the configured public origin.
| serviceId required | string <uuid> Example: 550e8400-e29b-41d4-a716-446655440000 UUID of the third-party OAuth2 service |
| redirect_uri required | string <uri> Example: redirect_uri=https://broker.example.com/sessions URI to redirect user after OAuth2 flow completes. Must match the configured public origin. The resulting provider-facing state must be shorter than 6,000 bytes; oversized requests receive a 400 response. |
{- "error": "invalid_redirect_uri",
- "message": "redirect_uri must be on the same origin as the configured public URL"
}Initiates an OAuth2 authorization code flow with PKCE when the consent page must preserve selections or return-page query parameters in its current tab.
The same-origin form body supplies the bare UUID consent_state_id. The broker
seals it in the private JWE state claim of the provider-facing authorization
request. Only a validated success callback includes it in the browser return URL.
The redirect_uri field must match the configured public origin and carry only
the return path; the browser retains its original return URL in sessionStorage.
State tokens of 6,000 bytes or more are rejected before provider redirect.
| serviceId required | string <uuid> Example: 550e8400-e29b-41d4-a716-446655440000 UUID of the third-party OAuth2 service |
| redirect_uri required | string <uri> Same-origin return page path without query or fragment. The original URL stays in the originating tab. |
| consent_state_id required | string <uuid> Bare UUID sealed in the JWE state claim and returned only on a successful callback, not a provider authorization parameter. |
{- "error": "string",
- "message": "string"
}Processes the OAuth2 callback after user authorization at the third-party.
PKCE applies to every service; the authorization-code exchange presents a client credential only for confidential services.
Validates:
On success:
On error:
| serviceId required | string <uuid> UUID of the third-party OAuth2 service |
| code required | string OAuth2 authorization code from third-party |
| state required | string JWE state token (must match token from authorize request) |
| error | string Example: error=access_denied OAuth2 error code from third-party (if authorization failed) |
| error_description | string Example: error_description=The user denied the request OAuth2 error description from third-party |
{- "error": "invalid_state",
- "message": "State token validation failed"
}Returns detailed information about the user's session with a third-party service, including only agents with grants owned by the authenticated session principal that depend on this session. Used to populate the session card and termination warning dialog.
| serviceId required | string <uuid> UUID of the third-party OAuth2 service |
{- "data": {
- "session": {
- "id": "660e8400-e29b-41d4-a716-446655440001",
- "principal": "user@example.com",
- "service_id": "550e8400-e29b-41d4-a716-446655440000",
- "service_display_name": "GitHub",
- "token_type": "Bearer",
- "initiated_at": "2025-12-20T10:30:00Z",
- "access_token_expires_at": "2025-12-20T11:30:00Z",
- "requires_reauthentication": false,
- "is_expired": false,
- "access_token_expired": false,
- "has_refresh_token": true,
- "scope": [
- "repo",
- "user:email"
], - "dependent_agent_count": 2,
- "is_encrypted": true,
- "encryption_context": {
- "service_id": "550e8400-e29b-41d4-a716-446655440000"
}, - "created_at": "2025-12-20T10:30:00Z",
- "updated_at": "2025-12-20T10:30:00Z"
}, - "dependent_agents": [
- {
- "agent_id": "770e8400-e29b-41d4-a716-446655440000",
- "display_name": "Code Assistant"
}, - {
- "agent_id": "770e8400-e29b-41d4-a716-446655440001",
- "display_name": "PR Reviewer"
}
]
}
}Terminates the user's session with a third-party service by deleting stored tokens. Returns information about affected agents for the confirmation dialog shown before this request.
Note: This does not revoke tokens at the third-party service.
Agents that were using this session will detect the missing session and request re-authentication.
| serviceId required | string <uuid> UUID of the third-party OAuth2 service |
{- "data": {
- "terminated": true,
- "affected_agents": 3
}
}Forces an immediate OAuth2 access-token refresh for the user's session with a third-party service, using the stored refresh token via the RFC 6749 refresh_token grant. Unlike the transparent refresh performed during token exchange, this refreshes even when the current access token has not yet expired. Requires a stored refresh token that the provider has not rejected.
| serviceId required | string <uuid> UUID of the third-party OAuth2 service |
{- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "service_id": "641e839f-864e-4cce-98f9-40f6cbb3e9e0",
- "service_display_name": "string",
- "token_type": "string",
- "scope": [
- "string"
], - "initiated_at": "2019-08-24T14:15:22Z",
- "requires_reauthentication": true,
- "is_expired": true,
- "access_token_expired": true,
- "has_refresh_token": true,
- "dependent_agent_count": 0,
- "is_encrypted": true
}
}Returns a list of agents that would lose access if the user terminates their session with this third-party service. Used to populate the termination warning dialog.
| serviceId required | string <uuid> UUID of the third-party OAuth2 service |
{- "data": {
- "affected_agents": [
- {
- "agent_id": "770e8400-e29b-41d4-a716-446655440000",
- "display_name": "Code Assistant"
}, - {
- "agent_id": "770e8400-e29b-41d4-a716-446655440001",
- "display_name": "PR Reviewer"
}
]
}
}Creates a pending approval record for a tool invocation that requires human-in-the-loop authorization. Called by ExtProc when a tool call is intercepted that requires approval. Dual-auth required: subject token + client assertion. The subject token binds the request to user/agent context, while the client assertion proves the trusted gateway caller that is allowed to mint approval prompts. Idempotent: returns existing record for duplicate pending requests.
| traceparent | string W3C Trace Context propagation header. |
required | object |
| tool_name required | string <= 255 characters |
required | object |
| risk_level | string Enum: "low" "medium" "critical" |
{- "metadata": {
- "mcp_session_id": "string",
- "agent_session_id": "string",
- "tool_invocation_id": "string",
- "description": "string"
}, - "tool_name": "string",
- "arguments": { },
- "risk_level": "low"
}{- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "status": "pending",
- "created_at": "2019-08-24T14:15:22Z"
}
}Returns all active approvals grouped by (principal, agent) pair. Supports long-poll via If-None-Match + X-Long-Poll-Timeout headers. Auth: client assertion only (CEL-validated). No subject token is required because this is a gateway control-plane sync channel rather than a user-facing operation.
| principal | string |
| agent_session_id | string Repeat for each active agent session. Session-scoped approvals are returned only for matching IDs. |
| If-None-Match | string |
| X-Long-Poll-Timeout | integer [ 1 .. 120 ] |
{- "data": {
- "pairs": [
- {
- "principal": "string",
- "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
- "approvals": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "tool_name": "string",
- "arguments_hash": "string",
- "tool_pattern": "string",
- "params_pattern": {
- "property1": "string",
- "property2": "string"
}, - "status": "pending",
- "persistence": "once",
- "consumed": true,
- "agent_session_id": "string",
- "approved_at": "2019-08-24T14:15:22Z"
}
], - "granted_permission_sets": { }
}
]
}
}Returns all pending approvals for the authenticated user.
Used by the approval and tool authorization UIs.
Auth: acting user principal from the browser auth layer (for example X-Remote-User in pre-auth deployments).
{- "data": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "principal": "string",
- "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
- "agent_display_name": "string",
- "mcp_session_id": "string",
- "agent_session_id": "string",
- "tool_invocation_id": "string",
- "tool_name": "string",
- "arguments": { },
- "tool_pattern": "string",
- "params_pattern": {
- "property1": "string",
- "property2": "string"
}, - "pattern_preview": "string",
- "description": "string",
- "risk_level": "low",
- "status": "pending",
- "persistence": "once",
- "consumed": true,
- "created_at": "2019-08-24T14:15:22Z",
- "approved_at": "2019-08-24T14:15:22Z",
- "denied_at": "2019-08-24T14:15:22Z",
- "consumed_at": "2019-08-24T14:15:22Z",
- "expires_at": "2019-08-24T14:15:22Z"
}
]
}Returns all permanent approvals and denials for the authenticated user.
Used by the consent management UI.
Auth: acting user principal from the browser auth layer (for example X-Remote-User in pre-auth deployments).
{- "data": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "principal": "string",
- "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
- "agent_display_name": "string",
- "mcp_session_id": "string",
- "agent_session_id": "string",
- "tool_invocation_id": "string",
- "tool_name": "string",
- "arguments": { },
- "tool_pattern": "string",
- "params_pattern": {
- "property1": "string",
- "property2": "string"
}, - "pattern_preview": "string",
- "description": "string",
- "risk_level": "low",
- "status": "pending",
- "persistence": "once",
- "consumed": true,
- "created_at": "2019-08-24T14:15:22Z",
- "approved_at": "2019-08-24T14:15:22Z",
- "denied_at": "2019-08-24T14:15:22Z",
- "consumed_at": "2019-08-24T14:15:22Z",
- "expires_at": "2019-08-24T14:15:22Z"
}
]
}Retrieves a tool approval record by ID for the Approval UI. Auth: acting user principal from the browser auth layer; principal must match.
| id required | string <uuid> |
{- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "principal": "string",
- "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
- "agent_display_name": "string",
- "mcp_session_id": "string",
- "agent_session_id": "string",
- "tool_invocation_id": "string",
- "tool_name": "string",
- "arguments": { },
- "tool_pattern": "string",
- "params_pattern": {
- "property1": "string",
- "property2": "string"
}, - "pattern_preview": "string",
- "description": "string",
- "risk_level": "low",
- "status": "pending",
- "persistence": "once",
- "consumed": true,
- "created_at": "2019-08-24T14:15:22Z",
- "approved_at": "2019-08-24T14:15:22Z",
- "denied_at": "2019-08-24T14:15:22Z",
- "consumed_at": "2019-08-24T14:15:22Z",
- "expires_at": "2019-08-24T14:15:22Z"
}
}Transitions a pending approval to approved state with selected persistence scope. Auth: acting user principal from the browser auth layer; principal must match.
| id required | string <uuid> |
| persistence required | string Enum: "once" "session" "permanent" |
object Constrained argument names mapped to globs. Omit the field to cover only the reviewed argument values. This field is permitted only for session or permanent persistence. With once persistence, every supplied value, including an empty object, returns 422 invalid_pattern. The resulting pattern must cover the reviewed arguments. |
{- "persistence": "once",
- "params_pattern": {
- "property1": "string",
- "property2": "string"
}
}{- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "status": "approved",
- "persistence": "once",
- "approved_at": "2019-08-24T14:15:22Z"
}
}| id required | string <uuid> |
object Constrained argument names mapped to globs. Omit the field entirely to cover only the reviewed argument values; send an empty object to leave every argument unconstrained. | |||
| |||
{- "params_pattern": {
- "property1": "string",
- "property2": "string"
}
}{- "data": {
- "tool_pattern": "string",
- "params_pattern": {
- "property1": "string",
- "property2": "string"
}, - "preview": "string"
}
}Transitions a pending approval to denied state. With persistence: permanent, blocks the exact tool for this principal and agent until revocation, regardless of arguments or session. Clears parameter constraints. ExtProc enforces the denial before matching approvals and does not create another approval request. Auth: acting user principal from the browser auth layer; principal must match.
| id required | string <uuid> |
| persistence | string Value: "permanent" |
{- "persistence": "permanent"
}{- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "status": "denied",
- "persistence": "permanent",
- "denied_at": "2019-08-24T14:15:22Z"
}
}Marks an approved once-persistence approval as consumed. Auth: subject token only (Bearer); principal must match. Idempotent: consuming already-consumed returns 200. No client assertion is required because this is a per-approval, principal-scoped machine mutation.
| id required | string <uuid> |
{- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "consumed": true,
- "consumed_at": "2019-08-24T14:15:22Z"
}
}Revokes a permanent approval or denial. Auth: acting user principal from the browser auth layer; principal must match.
| id required | string <uuid> |
{- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "status": "denied",
- "persistence": "permanent",
- "denied_at": "2019-08-24T14:15:22Z"
}
}