OAuth2 Token Endpoint
/auth/tokenThis API is used to generate OAuth2 tokens.
The current OAuth token endpoint supports:
- Refresh token grants.
- Authorization code token grants.
Public DCR/CIMD clients exchange authorization_code with client_id, redirect_uri, code_verifier and the same resource as the consent request. No client_secret is issued. Refresh these grants with grant_type refresh_token, client_id, rotating refresh_token and the original resource. Store the replacement securely.
Required scope
Not required
Request body
Fields
- grant_type
stringRequired The OAuth grant type. Use authorization_code for code exchange, or refresh_token to exchange a refresh token for an access token.
- client_secret
string Required for confidential clients. Public DCR/CIMD clients omit this field and use PKCE.
- subject_token
string Identity token to exchange; required for urn:ietf:params:oauth:grant-type:token-exchange.
- subject_token_type
string Subject token type; use urn:ietf:params:oauth:token-type:id_token for identity token exchange.
- resource
string Exact resource from authorization; canonical issuer for REST or issuer/mcp for MCP. Required for DCR and CIMD.
format: "uri"
Returns
200
Token generated successfully
Errors
400Invalid request payload
Check the request fields and any validation details, then correct the payload.
500Internal server error
Retry with backoff only when the operation is safe to repeat. Include the error code when reporting persistent failures.