Errors and troubleshooting
This page catalogs the error responses of the Truora Pass integration endpoints, the X-Request-ID header that identifies each request to Truora support, and the most common integration mistakes with their fixes.
The two error formats
The Truora Pass API uses two error envelopes, depending on the endpoint and grant:
Truora Pass error envelope — used by the authorization flow and by the authorization_code grant on POST /v1/oauth2/token:
| Field | Type | Description |
|---|---|---|
code |
integer | HTTP status code |
status |
string | HTTP status text |
message |
string | Human-readable description |
error_code |
string (optional) | Machine-readable error identifier |
fields |
array (optional) | Field-level validation details |
RFC 6749 error envelope — used by the refresh_token grant, the CIBA grant on POST /v1/oauth2/token, and POST /v1/oauth2/bc-authorize:
{
"error": "invalid_grant",
"error_description": "refresh token already used"
}
The X-Request-ID header
Every response from the Truora Pass API endpoints, success or error, carries an X-Request-ID header that names the request. Truora Pass logs each request under that value, so it is the value to share with Truora support. Truora keeps that log for one month: report a problem within a month of the request.
Two kinds of answer leave you no id. Errors that reach you through the browser (the authorize redirect and the embedded SDK result) are not responses to a call you made. Answers the API gateway gives itself, a CORS preflight (OPTIONS) and the gateway’s own failures, never reach Truora Pass.
- You may send your own. Set
X-Request-IDon a request, for example to your own trace id. Truora Pass returns it unchanged when it holds 1 to 128 characters, each a letter, a digit, or one of-,_,.and:, and checks this before it returns or logs the value. Use a fresh value per request, and never put a secret or personal data in it: it comes back in the response and Truora logs it. - Otherwise Truora Pass generates one. When you send none, or one outside those rules, the response carries an id Truora Pass generated instead of yours. Treat it as an opaque string.
- Quote the id that came back. The id on the response may differ from the one you sent, so always quote the one the response returned.
- It identifies, it does not authenticate. Any caller can send any value, so the id only helps support find a request. Give support your
client_idwith it, so support can check the request is yours. - Read it on your server. Call the Truora Pass API from your backend. A browser cannot read Truora Pass responses unless its origin is on the API’s allowed-origins list, which integrator sites are not. The CORS preflight also allows only a fixed list of request headers,
Authorizationamong them andX-Request-IDnot.
Log the id of every call yourself: see item 8 of Troubleshooting common mistakes.
The access token in this example has expired, so the API answers 401, and the response still carries the id you sent:
curl -i https://api.pass.truora.com/v1/oauth2/userinfo \
-H "Authorization: Bearer <access_token>" \
-H "X-Request-ID: my-trace-0001"
HTTP/2 401
...
x-request-id: my-trace-0001
When the answer carries no X-Request-ID |
What to do |
|---|---|
The authorize redirect to your redirect_uri, or the embedded SDK onError callback |
Give Truora support your client_id, the state, the error and error_description you received, and the time |
403 from the gateway: a path outside the API |
Check the path against the endpoints on this page |
429 from the gateway: throttled before the request reached Truora Pass |
See Throttled by the gateway |
504 from the gateway: Truora Pass did not answer in time, and the request may have run |
Give Truora support your client_id, the method, the path and the time, plus the X-Request-ID you sent if it met the rules above |
These gateway responses carry an x-amzn-RequestId header. It names the request at the gateway only, and Truora Pass’s request log is not keyed by it.
After a 504, do not resend a request that changes state. A token exchange may already have used the code, so start a new authorization. A bc-authorize may already have started an approval request, so resending it starts a second one.
Authorization errors (authorize redirect)
When the Authorization Code flow fails after the request is accepted, Truora Pass redirects the browser back to your redirect_uri with error and error_description query parameters instead of code. With the embedded SDK, the same information arrives through the onError callback as {error, error_description, state}.
Some failures are rejected before any redirect can happen and are shown to the user inside Truora Pass instead — your application only observes that the callback never fires:
| Condition | What happens |
|---|---|
redirect_uri does not exactly match a registered URI |
Request rejected in Truora Pass; no redirect to your application |
| A requested scope is not registered for your application | Request rejected in Truora Pass |
response_type is not code |
Request rejected in Truora Pass |
response_mode is not empty, query, or web_message |
Request rejected in Truora Pass |
response_mode=web_message without web_message enabled, or the embedding origin is not allow-listed |
Request rejected in Truora Pass |
Step-up conditions: acr_not_satisfied, session_too_old, email_domain_not_allowed |
Handled inside the Truora Pass UI; your application sees only the eventual callback success or error |
POST /v1/oauth2/token — authorization_code grant
Send Content-Type: application/json. Errors use the Truora Pass envelope:
| HTTP status | error_code |
Message |
|---|---|---|
| 401 | bad_credentials |
Invalid client credentials |
| 400 | validation_error |
Invalid or expired authorization code, or invalid client/redirect_uri |
POST /v1/oauth2/token — refresh_token grant
Send Content-Type: application/json. Errors use the RFC 6749 envelope:
| HTTP status | error |
When |
|---|---|---|
| 401 | invalid_client |
Client authentication failed |
| 400 | invalid_grant |
The refresh token is invalid or expired |
| 400 | invalid_grant — “refresh token was not issued to this client” |
The token belongs to a different client |
| 400 | invalid_grant — “refresh token already used” |
Reuse detected — the entire token family is revoked |
| 400 | invalid_grant |
The refresh token has expired, or was invalidated by a concurrent refresh (“invalid or already used”) |
| 400 | invalid_scope |
The requested scope is not a subset of the originally granted scopes |
See Refresh tokens for rotation and reuse-detection behavior.
POST /v1/oauth2/token — CIBA grant (polling)
Send Content-Type: application/x-www-form-urlencoded with grant_type=urn:openid:params:grant-type:ciba. Errors use the RFC 6749 envelope; all are HTTP 400 unless noted:
error |
When | What to do |
|---|---|---|
authorization_pending |
The user has not decided yet | Keep polling, waiting interval seconds between attempts |
access_denied |
The user declined the request | Stop — the auth_req_id is consumed |
expired_token |
The auth_req_id is unknown or expired, the request has expired, or it has already been redeemed |
Start a new backchannel request |
invalid_grant |
The auth_req_id was issued to a different client |
Check your client_id |
unsupported_grant_type |
The grant_type value is wrong |
Use urn:openid:params:grant-type:ciba |
unauthorized_client |
Your application is not allowed to use the CIBA grant | Ask your Truora contact to enable it |
invalid_client (HTTP 401) |
Client authentication failed | Check client_id / client_secret |
POST /v1/oauth2/bc-authorize
Errors use the RFC 6749 envelope:
| HTTP status | error |
When |
|---|---|---|
| 400 | invalid_request |
A sensitive scope (documents, background) was requested without binding_message |
| 400 | invalid_request — “the resolved user has no verified phone for delivery” |
The user exists but has no verified phone to receive the approval link |
| 400 | unknown_user_id |
The login_hint does not resolve to a Truora Pass user (it must be an email) |
| 503 | notifier_unavailable |
The approval message could not be delivered — retry later |
See the CIBA flow for the full request reference.
GET /v1/oauth2/userinfo
| HTTP status | Error | When |
|---|---|---|
| 401 | Missing or invalid Bearer token | No Authorization header, or the access token is invalid or expired |
| 401 | insufficient_scope — “Invalid token: missing scopes” |
The token carries no usable scopes |
| 404 | user_not_found |
The user behind the token no longer exists |
Troubleshooting common mistakes
-
redirect_urimismatch. Theredirect_uriin the authorization request must match a registered URI exactly (scheme, host, port, path), and theredirect_urisent to the token endpoint must match the one used in the authorization request. Register every URI you use — see Registering your application. -
Expired or re-used authorization code. Authorization codes live for 10 minutes and are single-use. Exchange the code immediately after receiving it, and never retry a token exchange with the same code — a second attempt returns
validation_error. If the code expired, restart the authorization flow. -
Scope not registered. Every scope in your authorization request must be registered for your application. Remove unregistered scopes, or add them yourself by editing your application in the Truora Pass Dashboard — see Registering your application and the Scopes reference.
-
Wrong
Content-Typeon/token. The token endpoint dispatches byContent-Type: useapplication/jsonfor theauthorization_codeandrefresh_tokengrants, andapplication/x-www-form-urlencodedfor the CIBA grant. Mixing them up makes the request land on the wrong grant handler. -
Polling faster than
interval. In the CIBA flow, wait theinterval(in seconds) returned bybc-authorizebetween polls of the token endpoint — polling faster does not speed up approval. -
Refresh token reuse. Refresh tokens rotate on every use: the old one is consumed and a new one is returned. Presenting an already-used refresh token is treated as reuse, and the entire token family is revoked — your application must send the user through the authorization flow again. Always persist the newest
refresh_tokenfrom each response. See Refresh tokens. -
web_message origin not allow-listed. The embedded SDK requires your application to be registered with
allows_web_messageenabled and the embedding page’s origin included inallowed_web_message_origins. If either is missing, Truora Pass rejects theresponse_mode=web_messagerequest. -
Not logging the
X-Request-ID. For every call, log the method, the path, the time of the request, theX-Request-IDyou sent and the one the response returned. Log the request before you send it, so a call that never gets an answer is still on record. When a response carries an id, give Truora support yourclient_id, that id and the time. For an answer that carries none, follow TheX-Request-IDheader section.
Throttled by the gateway (429)
Nothing was processed, so the same request is safe to send again, including a token exchange: the code was not used. Each attempt is a new request, so give it a fresh X-Request-ID.
- Wait one second before the first retry, then double the wait after each new
429, adding a random part of up to one second. - If the response carries a
Retry-Afterheader, wait at least that long instead. - Stop after five attempts. If
429persists, open a support case with yourclient_id, the endpoint and the times.