AADSTS50126

Invalid username or password

Last reviewed 2026-07-18 by the Just Software engineering team · also seen as 50126, InvalidUserNameOrPassword, error validating credentials

What it means

AADSTS50126 — "Error validating credentials due to invalid username or password." The username resolved to an account, but the password check failed. One-off occurrences are just typos; sustained streams of 50126 in the sign-in logs are diagnostic gold — they identify stale credentials, misconfigured clients or attack traffic.

Common causes

  1. Plain wrong password, including passwords typed into the wrong account after a rename.

  2. A saved/stale credential replaying an old password: mobile mail profiles, background services, scripts, legacy protocol clients (SMTP/IMAP/POP).

  3. Hybrid password hash sync lag right after an on-prem password change.

  4. Password-spray attacks — many accounts, few attempts each, legacy auth endpoints.

How to fix it

  1. Check the sign-in logs for the failing entries' client app, IP and device — 'Other clients'/legacy protocol entries point at old clients replaying credentials.

  2. After on-prem password changes, allow a couple of minutes for password hash sync; verify Entra Connect health if delays persist.

  3. Reset the password if the user is simply stuck, and clear saved credentials on their devices (Windows Credential Manager, mail apps).

  4. Block legacy authentication with Conditional Access to remove the favourite target of spray attacks producing 50126 noise.

Frequently asked

The password is definitely correct — why AADSTS50126?
Check where the attempt actually comes from: sign-in logs show the client and IP. It is very often not the user at all but a saved credential on another device or a background script replaying an old password. In hybrid setups, also check password hash sync recency.
An unhandled error has occurred. Reload 🗙