Launch offer for the first 500 accounts: $10K MTR free for 24 months + $100 credit →
    .io

    Auth Errors

    Errors are deliberately uninformative in one place

    Credential failures all look identical. That is a security property, not a gap — but it means debugging a sign-in needs a different approach, so this page says which errors carry information and which do not.

    The shape

    Code
    {
      "success": false,
      "error": { "code": "UNAUTHORIZED", "message": "The credentials provided are not valid." },
      "meta": { "request_id": "req_..." }
    }

    Switch on error.code rather than on the HTTP status — the codes are stable, and several share a status. Keep meta.request_id: it is what lets an operator find the matching server log.

    By status

    StatusCodeMeans, and what to do
    400VALIDATION_ERRORThe body failed schema validation, or a required capability token is missing. On sign-up this usually means a captcha or invitation is required — call auth-config to find out which
    400Password policyThe message names the rule that was missed — minimum length, a character class, or that the password appears in a breach corpus. Show it verbatim
    401UNAUTHORIZEDA credential failure. See above — nothing more is knowable client-side
    401INVALID_API_KEYThe key is wrong, revoked or expired. Distinct from the above: this is about your credential, not the user's
    403ACCESS_DENIEDAuth is not enabled on this project. The single most common first-call failure — Project Settings → Auth
    403INSUFFICIENT_PERMISSIONSAn operator endpoint called without owner or admin role, or a SCIM endpoint called with a non-SCIM token
    413—The request body exceeded 64 KB, refused at the edge before reaching a function
    429RATE_LIMITEDBack off. See limits for the buckets
    500INTERNAL_ERROROurs. Keep the request_id and send it to support

    Refresh failures

    auth-token collapses expired, revoked, reused, inactive, wrong-environment and wrong-project into the same opaque 401 — distinguishing them would tell an attacker whether the token they hold is real. Treat any 401 from refresh as "signed out": clear local state and show your sign-in surface.

    One case is worth knowing about even though you cannot detect it: presenting a rotated-away refresh token kills the entire session family, so the legitimate user is signed out on every device. If a user reports being signed out everywhere for no reason, a token replay is the likely cause.

    Second-factor failures need special handling

    Errors with no error

    The hardest failures here return 200. Each of these is a success response that did not do what you expected:

    SymptomCause
    Code never arrives for a phone numberThe dialling code is not in the project's allowlist, which defaults to +1 only. Refused before a message is queued
    Code never arrives at allMonthly SMS cap reached, or no email provider configured
    Phone sign-in returns the opaque 401 with a correct codeidentifier_kind was omitted, so the lookup searched email addresses
    A returning user signs up and no code arrivesSign-up issues a code only for a new identifier. Use auth-prepare
    A user appears signed in but has no entitlementsent_truncated was true and the list was read as complete
    Switching organization changes nothingset-active applies from the next refresh. Call auth-token

    Was this page helpful?

    Or rate this page:

    We use cookies and process your data to provide our services. By continuing, you agree to our Terms and Privacy Policy.