swepayError Catalog

Native Guard

Invalid Access Token 401

The Bearer token sent to the TOTP step-up was rejected.

type https://errors.swepay.com.br/native-guard/step-up-totp-invalid-token

What this means

Returned by POST /identity/v1/realms/{realm}/stepup/totp when a Bearer token was sent but cannot be accepted for the realm in the path: it failed signature or structure validation, is expired, was revoked, does not identify a user, or does not belong to that realm. It is also returned when the client the token was issued to is disabled. The TOTP code was not checked and no attempt was counted.

detail carries a short reason for diagnostics. Its wording is not part of the contract — do not branch on it.

Common causes

  • The access token is expired.
  • The token was revoked, for example after a logout.
  • The token was issued by a different realm than the one in the path, or that realm is not available.
  • The value is not an access token (an ID or refresh token), or it is malformed.

How to resolve

Obtain a new access token for that realm — refresh it, or sign the user in again — and repeat the step-up with it. The request is retryable only with a new token; resending the same one keeps returning 401. Never log or echo the token value.

Example response

HTTP 401 · application/problem+json
{
  "type": "https://errors.swepay.com.br/native-guard/step-up-totp-invalid-token",
  "title": "Invalid Access Token",
  "status": 401,
  "detail": "Token expired",
  "traceId": "Root=1-00000000-000000000000000000000000;Parent=0000000000000000;Sampled=0"
}

References

Machine-readable: /native-guard/step-up-totp-invalid-token.json