What the error means
AADSTS50126 is the Microsoft Entra code InvalidUserNameOrPassword. The token service received a username and password and could not validate them, so the sign-in failed at the first step, before any MFA or Conditional Access check. Microsoft's reference adds that administrators should expect to see some of these failures in the sign-in logs simply because people mistype passwords.
The code shows up in more places than the browser sign-in page. On a Windows PC joined to Microsoft Entra ID, it can appear in the dsregcmd /status output as the server error behind a failed primary refresh token (PRT) request, which is one reason Outlook and Teams keep asking for a password. It also appears in Power Automate desktop flow connections that use a Microsoft Entra account.
Common causes
- The password is wrong or out of date, or the user typed a different account name than intended.
- The user recently changed the password, the PC is Microsoft Entra hybrid joined, and the tenant uses password hash synchronization, so the cloud still holds the old password for a while.
- A saved password in an app, script or flow connection was not updated after a password change.
- A federated (AD FS) account is used by a process that sends the password straight to Microsoft Entra ID, such as a Power Automate desktop flow connection.
How to fix it
1. Check the account name and password
Confirm the full sign-in name (for example the work email address, not a personal Microsoft account) and type the password again without a password manager filling it in. As a general step, try the same account in a private browser window; if it fails there too, the password itself is the problem rather than the app.
2. Reset a forgotten password
This is a general step. Use your organization's self-service password reset if it is enabled, or ask the help desk for a reset. After a reset, update every app and device that stores the old password, including phone mail apps, scripts and Power Automate connections.
3. Refresh a Windows PC after a password change
Microsoft's PRT troubleshooting article lists a recent password change on a hybrid joined device with password hash sync as a documented cause, and the fix is to wait for synchronization to finish. Then lock and unlock the PC so Windows requests a fresh PRT, and check the SSO state:
dsregcmd /statusIn the SSO State section, AzureAdPrt should read YES and AzureAdPrtUpdateTime should be recent. If it still shows the AADSTS50126 server error, sign out of Windows and sign in with the current password. The Outlook password prompt guide covers the Outlook side of this problem.
4. Admins: read the failed sign-in
Sign in to the Microsoft Entra admin center as at least a Reports Reader and go to Entra ID, Monitoring and health, Sign-in logs. Filter by username and date and open the failed event. A single failure after a typo needs no action. As a general step, treat many failures for one account from unfamiliar locations as a possible password attack and review it rather than resetting blindly.
5. Admins: fix federated accounts used in automation
For Power Automate desktop flows, Microsoft's preferred fix is certificate-based authentication. If that is not possible, the documented alternative is password hash synchronization plus a Home Realm Discovery policy that sets this value:
"AllowCloudPasswordValidation": trueIf nothing works
Check that the account is not disabled or locked, then give the help desk the correlation ID and time from the error. If a Windows PC still fails after the password has synced, the PRT article describes collecting AAD Operational and Analytic logs in Event Viewer for a support case.
What we checked
Three Microsoft Learn pages were read on 2026-11-19. The Microsoft Entra error codes reference defines AADSTS50126 as InvalidUserNameOrPassword. The primary refresh token troubleshooting article shows the code in dsregcmd output and lists the password hash sync timing cause and its fix. The Power Automate desktop flow article covers the federated user case and the certificate and Home Realm Discovery fixes. The error was not reproduced for this page.
Last checked: 2026-11-19.