invalid algorithm Authentication Origin: Application & API Last updated 15 Oct 2026

JWT error: invalid algorithm / The specified alg value is not allowed / jwt signature is required

The token’s alg header doesn’t match the algorithms the verifier allows — e.g. RS256 token verified as HS256, or an unsigned (alg: none) token.

Exact message you may see invalid algorithmThe specified alg value is not allowedjwt signature is requiredalg not allowed
Seen on: REST API

Meaning

Verifiers must pin allowed algorithms. Mixing HS256 secrets with RS256 tokens (or the reverse), copying keys in the wrong format, or tampered tokens produce these errors.

Common causes

  • Verifying RS256 tokens with an HS256 secret (or vice versa)
  • algorithms option not matching the issuer
  • Token with alg none / unsigned
  • Wrong key format (PEM vs JWK)

⚡ Quick fix

  1. Set algorithms explicitly to the issuer’s algorithm
  2. Use the issuer’s public key/JWKS for RS256/ES256
  3. Reject unsigned tokens

Detailed fix by platform

JavaScript

  1. jwt.verify(token, publicKeyPem, { algorithms: ["RS256"], issuer: "https://auth.example.com/", audience: "api://orders" });

Python

  1. jwt.decode(token, key, algorithms=["RS256"], audience="api://orders")

How to diagnose

  1. Header — alg in the token (decode header)
  2. Verifier — Allowed algorithms and key type

🔧 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):

0x800704EC — 0x800704EC: This program is blocked by group policy (Windows Defender) (Windows)0x800704EC1005 — Cloudflare Error 1005: Access denied — The owner of this website has banned the autonomous system number (ASN) your IP address is in (Cloudflare)10051006 — Cloudflare Error 1006 / 1007 / 1008: Access denied — Your IP address has been banned (Cloudflare)10061009 — Cloudflare Error 1009: Access denied — The owner of this website has banned the country or region your IP address is in (Cloudflare)10091010 — Cloudflare Error 1010: The owner of this website has banned your access based on your browser's signature (Cloudflare)10101011 — Cloudflare Error 1011: Access denied (Hotlinking denied) (Cloudflare)10111012 — Cloudflare Error 1012: Access denied (Cloudflare)1012AADSTS50053 — AADSTS50053: Your account is locked (Smart Lockout) / sign-in blocked due to suspicious activity (Azure)AADSTS50053invalid a…

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.