Given token not valid Authentication Origin: Application & API OSI layer 7 · Application Last updated 28 Nov 2026

{"detail":"Given token not valid for any token type","code":"token_not_valid"}

Simple JWT could not accept the token — it is expired, signed with a different key or of the wrong type.

Exact message you may see Given token not valid for any token typesimplejwt token_not_valid
Seen on: Python Django

Meaning

The response's messages array says why. The commonest cause is an expired access token; others are a refresh token sent where an access token is expected or a different SIGNING_KEY between instances.

Common causes

  • Access token expired (default 5 minutes)
  • Refresh token used as an access token
  • SECRET_KEY changed or differs between servers
  • Token blacklisted after logout

⚡ Quick fix

  1. Refresh the access token with the refresh endpoint
  2. Send the access token in the header
  3. Keep the same SIGNING_KEY on every instance

Detailed fix by platform

Simple JWT

  1. POST /api/token/refresh/ with {"refresh": "<token>"}; adjust ACCESS_TOKEN_LIFETIME if needed

How to diagnose

  1. Reason — What does messages[0] say?
  2. Type — Access or refresh token?
  3. Key — Same signing key everywhere?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

alg none — JWT error: algorithm "none" is not allowed / Algorithm not supported (Authentication)alg nonecredentials were not provided — Authentication credentials were not provided (Django REST Framework 401/403) (Authentication)credentials were not …invalid algorithm — JWT error: invalid algorithm / The specified alg value is not allowed / jwt signature is required (Authentication)invalid algorithminvalid_client — Sign in with Apple: invalid_client (Authentication)invalid_clientinvalid_token — invalid_token: The access token is invalid (JsonWebTokenError: invalid signature / jwt malformed) (Authentication)invalid_tokenJWEDecryptionFailed — NextAuth: JWEDecryptionFailed: decryption operation failed (Authentication)JWEDecryptionFailedjwt audience invalid — JsonWebTokenError: jwt audience invalid. expected: … (Authentication)jwt audience invalidJWT expired — Supabase: JWT expired (PGRST301) (Authentication)JWT expiredGiven tok…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.