UnrecognizedClientException AWS Origin: Platform & cloud OSI layer 7 · Application Last updated 13 Oct 2026

UnrecognizedClientException: The security token included in the request is invalid

The access key or session token isn’t recognised — wrong/deleted key, a session token missing for temporary credentials, or a region not enabled for the account.

Exact message you may see The security token included in the request is invalid
Seen on: AWS

Meaning

Temporary credentials need all three values (key ID, secret, session token). Copying only two, using deleted keys, stale environment variables overriding the profile, or calling an opt-in region that isn’t enabled all produce this.

Common causes

  • AWS_SESSION_TOKEN missing or stale for temporary keys
  • Access key deleted/deactivated
  • Old env vars overriding ~/.aws profile
  • Opt-in region not enabled

⚡ Quick fix

  1. Check identity: aws sts get-caller-identity
  2. Unset stale AWS_* env vars or refresh them
  3. Enable the region in Account settings if opt-in

Detailed fix by platform

Shell

  1. bash
    env | grep ^AWS_
    unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN
    aws sts get-caller-identity --profile prod

How to diagnose

  1. Credentials — Where are they coming from (env, profile, role)?
  2. Token — Session token present?
  3. Region — Opt-in region?

🔧 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: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

401 — HTTP 401 Unauthorized (HTTP)401401 — 401 Unauthorized without WWW-Authenticate header (HTTP)401454 — 454 4.7.0 Temporary authentication failure (SMTP AUTH backend unavailable) (Email / SMTP)454535 5.7.3 — Microsoft 365: 535 5.7.3 Authentication unsuccessful (SMTP AUTH / client submission blocked) (Email / SMTP)535 5.7.3AADSTS50076 — Azure AD (Entra ID): AADSTS50076 / AADSTS50079 — multi-factor authentication required (Azure)AADSTS50076AADSTS50126 — AADSTS50126: Error validating credentials due to invalid username or password (Azure)AADSTS50126AADSTS700016 — Azure AD (Entra ID): AADSTS700016 Application not found in the directory (Azure)AADSTS700016Atlas: bad auth: Authentication failed — MongoServerError: bad auth : Authentication failed. (Atlas user / special characters in password) (MongoDB)Atlas: bad auth: Auth…Unrecogni…

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.