AADSTS50126 Entra ID sign-in error Triage: medium

AADSTS50126: Invalid Username or Password — Typo or Password Spray?

Published

Entra ID rejected the password (or the username) for this sign-in. One failure is a typo; the same failure across many accounts from one IP is password spraying.

Did the attacker have the password? No — the password (or username) was wrong.

Microsoft's definition

InvalidUserNameOrPassword

InvalidUserNameOrPassword - Error validating credentials due to invalid username or password. The user didn't enter the right credentials. Expect to see some number of these errors in your logs due to users making mistakes.

Source: Microsoft Entra authentication and authorization error codes · checked against the published table on every build

Where it appears

  • Microsoft Sentinel / Log Analytics: the ResultType column of SigninLogs and AADNonInteractiveUserSignInLogs
  • Microsoft Graph signIns API and JSON exports: status.errorCode, with the text in status.failureReason
  • Entra admin center sign-in log download (CSV): the Sign-in error code column

What it means

AADSTS50126 is a first-factor failure: the request reached Entra ID with a username and a password, and the password check failed. Nothing after that step ran — no MFA prompt and no Conditional Access decision — which is why these entries normally show conditionalAccessStatus: notApplied. The failureReason text in a Graph export reads “Invalid username or password or Invalid on-premises username or password.”

A single 50126 tells you about an attempt, not about access. The value comes from grouping: by source IP, by account and by client.

Is it an attack?

PatternWhat it usually is
One user, a few failures, then a success from the same IPA typo
One user, failures on a fixed interval from their usual IPA stale password saved in a mail app or device
One IP, failures across many accounts, one to three attempts eachPassword spraying
Many accounts and IPs, mixed with AADSTS50034 for names that do not existCredential stuffing from a leaked list
One account, many attempts in minutes, ending in AADSTS50053Brute force that hit smart lockout

Signals that move a cluster from “noise” to “attack”: legacy client apps (Exchange ActiveSync, IMAP4, POP3, Authenticated SMTP, Other clients), scripted user agents such as python-requests or BAV2ROPC, source IPs in hosting, VPN or Tor ranges, and attempts outside the users’ working hours. The LogTriage rule for legacy-auth sign-ins that bypass MFA covers the protocol side of the same campaigns.

How to investigate

Start with the sources, not the users. This finds IPs that failed for five or more accounts in the last day, across interactive and non-interactive sign-ins (scripted and legacy attempts often land in the non-interactive table):

union SigninLogs, AADNonInteractiveUserSignInLogs
| where TimeGenerated > ago(1d)
| where ResultType == "50126"
| summarize Failures = count(), Accounts = dcount(UserPrincipalName),
            SampleAccounts = make_set(UserPrincipalName, 10),
            ClientApps = make_set(ClientAppUsed, 5)
    by IPAddress
| where Accounts >= 5
| order by Accounts desc

The question that decides severity is whether any of those sources also succeeded. A spray that never succeeds is an attempt; one success turns it into an incident:

let sprayIPs = union SigninLogs, AADNonInteractiveUserSignInLogs
    | where TimeGenerated > ago(1d) and ResultType == "50126"
    | summarize Accounts = dcount(UserPrincipalName) by IPAddress
    | where Accounts >= 5
    | project IPAddress;
union SigninLogs, AADNonInteractiveUserSignInLogs
| where TimeGenerated > ago(1d)
| where IPAddress in (sprayIPs) and ResultType == "0"
| project TimeGenerated, UserPrincipalName, IPAddress, AppDisplayName, ClientAppUsed

Also look for AADSTS50074 or AADSTS50076 from the same IPs: those codes mean the password worked and only MFA stopped the attacker.

If there is no success, block the sources with a named location, confirm legacy authentication is blocked by Conditional Access, and keep watching the accounts that were targeted. If any account succeeded, treat it as compromised: reset the password, revoke its sessions, review its registered MFA methods and check for new inbox rules or app consents. Without Sentinel, the same grouping works on a portal CSV export — filter on Sign-in error code 50126 and pivot on IP address, or drop the export into the free browser analyzer.

Related codes

  • AADSTS50053 This error can result from two different reasons: IdsLocked Entra ID refused the sign-in before accepting it: either smart lockout has locked the account after repeated failures, or the source IP was blocked for malicious activity.
  • AADSTS50034 UserAccountNotFound
  • AADSTS50057 UserDisabled
  • AADSTS50055 InvalidPasswordExpiredPassword
  • AADSTS50074 UserStrongAuthClientAuthNRequiredInterrupt The password was correct and Entra ID asked for multifactor authentication, which this request did not complete. Followed by a success it is routine; alone, from an unfamiliar place, it means someone else knows the password.
  • AADSTS50076 UserStrongAuthClientAuthNRequired Entra ID accepted the username and password, then required multifactor authentication that this request did not provide. From scripts or legacy mail clients it is strong evidence that whoever sent it knows the password.

Detect it

MITRE ATT&CK: T1110.003T1110.001T1110.004

Frequently Asked Questions

Does AADSTS50126 mean the account exists?
Usually, but not reliably. Entra ID normally answers a username that is not in the tenant with AADSTS50034, so a 50126 typically points at a real account with a wrong password. Federated domains and some client flows report failures differently, so confirm the account in your directory before treating a 50126 as proof that it exists.
How many AADSTS50126 failures are normal?
Microsoft's own description says to expect some, because people mistype passwords. What matters is the shape: a handful per user spread across the day is normal, the same source IP failing for five or more different accounts within an hour is the classic password-spray signature, and dozens of failures against one account in minutes is brute force that smart lockout (AADSTS50053) will usually cut off.
Why does a user's own phone produce AADSTS50126 every few minutes?
Almost always a stale password saved in a mail app or synced device after a password change. The source IP matches the user's normal locations, the client app is Exchange ActiveSync or Mobile Apps and Desktop clients, and the failures repeat on the app's sync interval. Updating the stored password stops them; the same pattern from an unfamiliar IP would be an attacker.
Can smart lockout stop a password spray that produces AADSTS50126?
Only partly. Smart lockout counts failures per account, and spraying deliberately stays below that threshold with one or two guesses per account. That is why the per-IP, many-accounts view in the queries on this page is the one that catches spraying, and why blocking legacy authentication matters: many sprays target protocols that cannot perform MFA.

Find AADSTS50126 in your own logs

Drop an Entra ID sign-in export into the free browser analyzer to see which users and IPs hit this code (nothing is uploaded), or run it through LogTriage for threat-intel enrichment and an AI-written incident report.