Home

Documentation

Documentation

Error Codes

Error codes from every XAA endpoint, with causes and fixes.

How to read this

Each section covers one endpoint. The Cause column is the specific reason the server rejected the request. Multiple causes can share the same error code.


IDP: Token Exchange

Endpoint: POST https://idp.xaa.dev/token with grant_type=urn:ietf:params:oauth:grant-type:token-exchange

HTTPError CodeCauseFix
400invalid_requestA required parameter is missing (audience, resource, subject_token, subject_token_type, or requested_token_type)Include all required parameters. See Step 2 for the complete list.
400invalid_requestsubject_token_type is not urn:ietf:params:oauth:token-type:id_tokenUse the correct token type; only ID Tokens are accepted
400invalid_requestID Token signature verification failedThe ID Token must be a valid JWT issued by this IDP; do not modify or hand-craft tokens
400invalid_requestID Token aud doesn't match the authenticated client_idYour client must present an ID Token that was issued to it. The aud claim must equal your client_id.
400invalid_requestID Token has no sub claimThe ID Token must contain a subject identifier; re-authenticate
400invalid_targetClient has resource connections but none match the requested audience + resource combinationRe-register the resource using the wizard. The client's resource connections must include this auth server and API URL pair.
400invalid_scopeOne or more requested scopes are not permitted for this resource connectionRemove the invalid scopes, or re-register the resource and add the missing scopes in Wizard Step 3
500server_errorInternal server error during token generationCheck server logs; retry once

Auth Server: JWT Bearer Grant

Endpoint: POST https://auth.resource.xaa.dev/token with grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

HTTPError CodeCauseFix
400invalid_grantID-JAG typ header is not oauth-id-jag+jwtOnly use ID-JAGs from the IDP's token exchange; do not hand-craft the assertion
400invalid_grantID-JAG iss is not a trusted issuerThe IDP URL must be configured as a trusted provider; check that you're using the correct IDP
400invalid_grantSignature verification failedThe ID-JAG has been tampered with or was signed by a different key
400invalid_grantID-JAG iat is more than 30 seconds in the futureCheck server clock synchronization; the IDP and Auth Server clocks are more than 30 seconds apart
400invalid_grantID-JAG has expired (exp in the past)ID-JAGs expire in 5 minutes. Get a fresh one from Step 2 and retry immediately.
400invalid_grantID-JAG client_id doesn't match the authenticating clientUse your resource client credentials (client_id-at-resource), not your main client credentials
400invalid_grantID-JAG aud doesn't match this Auth Server's URLIn Step 2, set audience to this server's URL exactly. Check for trailing slash discrepancies.
401invalid_clientClient authentication failed (wrong credentials)Verify your resource client ID and secret; re-register via Client Registration if needed
400unauthorized_clientClient is not registered at the Auth ServerRegister via Client Registration with a resource connection
Scope not reduced to empty

If the requested scope is not a subset of the ID-JAG's scope, the Auth Server does not reject the request. It issues a token with the intersection. An empty intersection produces a token with no scope, which will fail at the resource server with 403 insufficient_scope.

See Token Structure → Scope intersection rule for details.


Resource Server

Endpoint: GET https://api.resource.xaa.dev/api/todos (and other protected routes)

HTTPError CodeCauseFix
401unauthorizedNo Authorization headerAdd Authorization: Bearer <access_token> to every request
401invalid_tokenToken expired, signature invalid, wrong issuer, wrong algorithm, or aud does not match the URL registered in Wizard Step 1Get a new access token from Step 3; verify your token against https://auth.resource.xaa.dev/jwks using RS256; set your middleware's expected audience to the exact URL you registered (trailing slash must match)
403insufficient_scopeToken doesn't include the required scopeEnsure the scope was requested in Step 2 and granted in Step 3. Check the scope claim in your access token.

Per RFC 6750, resource servers should return a WWW-Authenticate: Bearer challenge on 401/403 so clients can distinguish the failure mode:

http
http

MCP Server

Endpoint: POST https://mcp.xaa.dev/mcp

HTTPJSON-RPC ErrorCauseFix
401Unauthorized: Invalid or expired access tokenMissing, expired, wrong-audience, or invalid Bearer tokenSame as Resource Server invalid_token above. The aud must match the resource URL you registered in Wizard Step 1 (the MCP URL is not the audience — the resource URL is).
403Insufficient scopesToken lacks todos.read or mcp.accessRequest both scopes in Step 2: scope: 'todos.read mcp.access'
406(none)Accept header missing or doesn't include text/event-streamAdd Accept: application/json, text/event-stream to all requests

MCP servers implementing RFC 9728 should include a resource_metadata hint on 401 so agents can auto-discover the Auth Server:

http

Common debugging checklist

If you're stuck and unsure which error applies:

  1. Decode your token: use the Token Decoder tab in the Demo's detail panel to inspect iss, aud, scope, and exp
  2. Check expiry: ID-JAG: 5 min, Access Token: 2 hours
  3. Check aud: must be the exact URL of the service that consumes the token (no trailing slash mismatch)
  4. Check scope: remember the intersection rule
  5. Check clock skew: if iat errors appear, synchronize your server's system clock

These materials and any recommendations within are not legal, privacy, security, compliance, or business advice. These materials are intended for general informational purposes only and may not reflect the most current security, privacy, and legal developments nor all relevant issues. You are responsible for obtaining legal, security, privacy, compliance, or business advice from your own lawyer or other professional advisor and should not rely on the recommendations herein.

Presented byOkta Developer

Copyright © 2026 Okta. All rights reserved.