Error fix

How to fix “401 Unauthorized

Authentication failed or was missing—bad credentials, expired token, or wrong auth scheme.

Updated Apr 20, 2026

Tools that help with this

Fastest fix

Start here first. Step 1 fixes most cases—then work down the list.

  1. Re-login or refresh tokens using the app’s documented flow.
  2. Verify API keys and that secrets match the target environment.
  3. Check reverse proxies forward Authorization and Cookie headers.

What this means

The server expects a valid identity for this resource. Until auth succeeds, access is denied.

Common causes

  • Expired sessions

    JWT expiry, rotated API keys, or clock skew.

  • Wrong scheme

    Bearer vs Basic, missing Authorization header, or CORS preflight stripping headers.

Step-by-step fix

  1. Restore valid auth

    1. Re-login or refresh tokens using the app’s documented flow.
    2. Verify API keys and that secrets match the target environment.
    3. Check reverse proxies forward Authorization and Cookie headers.

Also see: 401 — browse the HTTP status hub.

FAQ

401 vs 403?
401 means authenticate; 403 means authenticated but not allowed.
401 on APIs only in browser?
CORS may hide headers—test with curl and compare preflight.
Intermittent 401?
Look for token refresh races and short access token lifetimes.

Still stuck? Try these related fixes next.

Edit your error

Tweak the message and run again—we'll match an existing fix or generate a new page.

Original error message
401 Unauthorized
Fix another errorHTTP status codesURL status checkerRedirect checkerAll tools