AADSTS error codes: the sign-in errors you'll actually meet
AADSTS error codes run to hundreds. These are the forty or so seen in real apps, connectors and pipelines, grouped by what's wrong, each with its cause and its fix.
Identity & securityQuick reference14 min read
Every sign-in failure against Microsoft Entra ID comes back as an AADSTS error code, and Microsoft's reference lists several hundred of them in numerical order, one line each. In practice a few dozen account for nearly every failure a Power Platform connector, a web app, a script or a pipeline will ever show you, and the fix is usually one setting. This page is that shorter list, grouped by what has actually gone wrong, with the fix beside each code. Two habits first: the error text names the app ID, tenant and the offending value, so read the whole message; and for any code you can paste it at https://login.microsoftonline.com/error to get Microsoft's own explanation. The Entra sign-in logs show the same codes as plain numbers, so "error code 50072" in a log is AADSTS50072 here.
The app registration
| Code | What it means | Fix |
|---|---|---|
| AADSTS50011 | The redirect (reply) URL in the request doesn't match any configured on the app registration | Copy the URL from the error message. In the app registration's Authentication settings, add it as a redirect URI for the right platform; it must match exactly, and Microsoft notes the match is case-sensitive. Allow a few minutes. Custom connectors have their own unique redirect URL on the Security tab |
| AADSTS700016 | The application (client ID) wasn't found in this tenant | The client ID is wrong, or the sign-in went to the wrong tenant (common or another tenant ID). Check both. A multi-tenant app must have been consented in the target tenant first |
| AADSTS500011 | The resource (the API you're asking a token for) has no service principal in this tenant | The API's app registration isn't provisioned or consented in the tenant, or the resource URL or tenant ID is wrong. Check Enterprise apps > All applications for the API |
| AADSTS50001 | The resource is disabled or doesn't exist | Use the exact resource identifier or scope (https://graph.microsoft.com/.default, api://<client-id>/.default) |
| AADSTS65005 | The app asks for a resource that isn't in its required permissions list, or a SAML app has the wrong Identifier | Add the permission under API permissions, or fix the SAML Identifier (Entity ID) |
| AADSTS70011 | The scope requested is invalid | Scopes are <resource>/<permission> or <resource>/.default; check for typos and the right resource |
| AADSTS90002 | The tenant name wasn't found | The tenant ID or domain is wrong, often an app from one cloud (public, Government, China) pointed at another |
| AADSTS9002313 | The request is malformed | A missing or misencoded parameter; capture the request and compare it with the protocol documentation |
Consent and assignment
| Code | What it means | Fix |
|---|---|---|
| AADSTS65001 | Nobody has consented to this app using that permission | Send an interactive sign-in so the person can consent, or an admin grants admin consent on the app's API permissions |
| AADSTS90094 | The app asks for permissions that only an admin can grant, and the person signing in isn't one. It also appears when Microsoft rates the request as risky, or when the app requires user assignment and nobody has given admin consent | An admin grants admin consent for the whole organisation on the app's API permissions. Application (app-only) permissions always need it. So that people can ask instead of hitting a wall, an admin can turn on the admin consent workflow |
| AADSTS65004 | The person declined consent. With the admin consent workflow on, it's also what the app receives after someone submits a consent request and goes back to the app | Ask them to sign in again and accept, or an admin consents for everyone (or approves the pending request) |
| AADSTS50105 | The app requires user assignment and this person isn't assigned | In Enterprise apps > All applications > the app > Users and groups, assign them, or turn off Assignment required |
The app's credential
| Code | What it means | Fix |
|---|---|---|
| AADSTS7000215 | The client secret is wrong | You pasted the secret's ID instead of its value, or a stale value. Create a new secret, copy the Value immediately, and update the app |
| AADSTS7000222 | The client secret has expired | Create a new secret; consider a certificate or a federated credential instead, which don't leak the same way |
| AADSTS7000218 | The request has no client_secret or client_assertion | The app is treated as a confidential client but sent none; add the credential, or register it as a public client if it's a desktop or mobile app |
| AADSTS700027 | The client assertion failed signature validation, for example because the certificate it was signed with has expired or isn't the one registered | Upload a current certificate under Certificates & secrets, and check the thumbprint the app signs with |
| AADSTS54005 | The authorization code has already been redeemed | A code can be swapped for a token only once. A common cause: a library or web framework already redeems the code automatically, and the app's own code redeems it again. Let one of them redeem it, then use the refresh token, or start a new sign-in for a new code |
| AADSTS70000 | The refresh token isn't valid; Microsoft names token binding (an empty header, or a hash that doesn't match) as the reasons | Sign in again for a new token |
| AADSTS700082 | The refresh token expired through inactivity | Normal: the person hasn't used the app in a long time; sign in again |
| AADSTS50173 | The grant has expired because it was revoked, usually after the password was changed or reset | Sign in again with a fresh token |
The person signing in
| Code | What it means | Fix |
|---|---|---|
| AADSTS50126 | Wrong username or password | Expect some of these from mistyped passwords; the person signs in again with the right one, or resets it |
| AADSTS50034 | The account isn't in this tenant | The person typed the wrong name, or the app chose the wrong tenant; if they should be in, add them as a guest |
| AADSTS51004 | The account doesn't exist in the directory the app signed in to; usually the app picked the wrong tenant | Point the app at the right tenant. If the person should have access to this one, add them as a guest |
| AADSTS50020 | The account from another identity provider isn't a user in this tenant | Add them as an external (guest) user first, or have them sign in with the right account |
| AADSTS50053 | The account is locked after repeated failed sign-ins, or the sign-in came from a blocked IP | Wait, or an admin unblocks in ID Protection |
| AADSTS50055 | The password has expired | The person resets it, or an admin does |
| AADSTS50057 | The account is disabled | An admin re-enables it, in Entra or in on-premises Active Directory if it's synced |
| AADSTS50058 | No signed-in session for silent sign-in | Expected when nobody is signed in; the app should fall back to an interactive sign-in |
| AADSTS50059 / 50128 | No tenant information in the request or the credentials | Pass the tenant ID or a verified domain |
MFA and Conditional Access
| Code | What it means | Fix |
|---|---|---|
| AADSTS50076 | MFA is required by a Conditional Access policy, per-user MFA or a new location | Retry with an interactive request so the person can complete MFA. A user account that runs a script or pipeline has to complete MFA too (a passkey or certificate-based authentication can), and Microsoft recommends moving that automation to a managed or workload identity (our mandatory MFA guide) |
| AADSTS50072 | The person has to enrol in multifactor authentication before the sign-in can go on (an interactive step) | They register a method at aka.ms/mysecurityinfo, then sign in again |
| AADSTS50079 | MFA is now required (a Conditional Access policy, per-user MFA or a new location) and the person hasn't set it up | A cloud account registers its security information at aka.ms/mysecurityinfo; a federated account gets the MFA claim from its own identity provider |
| AADSTS50074 | The MFA challenge wasn't passed | Try again; check the authentication methods registered |
| AADSTS50097 | Device authentication is required: a Conditional Access policy only accepts sign-ins from a device the organisation manages, and the app didn't prove which device it's on | Sign in through the device's broker. On Windows, use an app that signs in through Windows (WAM), or Edge, or Chrome with Microsoft's sign-in extension; on iOS and Android, install Microsoft Authenticator or Company Portal. Device authentication can also fail in an InPrivate or Incognito window, so try a normal one |
| AADSTS70043 | The refresh token has expired, or isn't valid, because of a Conditional Access sign-in frequency check | Expected once the policy's sign-in frequency has passed: the person signs in again interactively. If it happens too often, check the sign-in frequency on the policy named in the sign-in's Conditional access tab |
| AADSTS53003 | A Conditional Access policy blocked the sign-in | Open the sign-in in the sign-in logs, on its Conditional access tab, to see which policy; use the What If tool to test a fix (our break-glass and Conditional Access guide) |
| AADSTS50158 | An external challenge (terms of use, a third-party MFA provider) must be satisfied | Not a failure by itself; the person is being redirected to complete it |
| AADSTS90072 | An external account can't satisfy this tenant's MFA, or a synced account's anchor doesn't match | Add the account as an external user, or fix the ImmutableID mismatch between Active Directory and Entra |
Federated credentials for pipelines
| Code | What it means | Fix |
|---|---|---|
| AADSTS70021 | No federated identity credential matches the token the pipeline presented: issuer or subject differs | Compare the issuer and subject in the error with the federated credential on the app or managed identity. Renaming a GitHub repository, environment or branch breaks the match, and so does renaming an Azure DevOps organisation, project or service connection when the connection uses the legacy subject (the newer subject uses IDs). Leading or trailing spaces in the issuer or subject block it too. New credentials take a few minutes to replicate |
| AADSTS700211 | No credential matches the issuer | Fix the issuer. Azure DevOps's new issuer is https://login.microsoftonline.com/<tenant id>/v2.0; GitHub's is https://token.actions.githubusercontent.com |
| AADSTS700213 | No credential matches the subject | Fix the subject: repo:<org>/<repo>:environment:<name> (GitHub); for Azure DevOps, sc://<org>/<project>/<connection> with the legacy issuer, or <prefix>/sc/<organization id>/<service connection id> with the Entra issuer. It must match exactly |
| AADSTS70025 | The app has no federated credentials at all | Add one in the app's Certificates & secrets, on its federated credentials tab |
| AADSTS700223 | Workload identity federation is disabled or constrained on the tenant | Ask the tenant admin, or federate against a user-assigned managed identity instead |
Reading an AADSTS error code
The text after the code carries the values you need: the client ID (application with identifier '…'), the tenant, the redirect URI or the assertion's issuer and subject. The Sign-in logs in the Entra admin centre show the same failure with the Conditional access and Authentication details tabs, which say which policy or method was involved. And a code that isn't on this page is on Microsoft's full list; paste it at the error lookup address above before you search anywhere else.
What a failed sign-in shows in the sign-in logs, as of April 2026:
- Sign-in events is the new sign-in log view, in preview; its banner offers a way back to the legacy experience. Here the list is filtered to Status : Failure.
- Selecting a sign-in opens Activity Details: Sign-ins on the Basic info tab.
- Sign-in error code shows the code without the prefix: 50011 here is AADSTS50011.
- Failure reason carries the full message, with the redirect URI the app sent and its application ID; Additional details adds Microsoft's note on the cause.
- Investigate with Copilot (a preview) and Launch the Sign-in Diagnostic. start Microsoft's own troubleshooting for this sign-in.

Sources
- Microsoft Entra authentication and authorization error codes, Microsoft Learn (the full list)
- Error AADSTS50011: the redirect URI does not match, Microsoft Learn
- How to add a redirect URI to your application, Microsoft Learn
- AADSTS500011: resource principal not found, Microsoft Learn
- Troubleshoot an Azure Resource Manager workload identity service connection, Microsoft Learn (70021, 700211, 700213, 70025, 700223)
- Important considerations and restrictions for federated identity credentials, Microsoft Learn
- Mandatory multifactor authentication for Azure and admin portals, Microsoft Learn
- Troubleshoot sign-in problems with Conditional Access, Microsoft Learn (codes in the sign-in logs without the AADSTS prefix)
- Unexpected error when performing consent to an application, Microsoft Learn (90094, 65004)
- Assign users and groups to an application, Microsoft Learn (Enterprise apps, All applications)
- Redirect URI (reply URL) restrictions, Microsoft Learn
- Certificate credentials in Microsoft.Identity.Web, Microsoft Learn (700027 with an expired certificate)
- Configure the admin consent workflow, Microsoft Learn
- Authentication flow support in MSAL: authorization code, Microsoft Learn (54005)
- Device authentication errors in MSAL.NET, Microsoft Learn (50097)
- Error AADSTS530004: device authentication fails, Microsoft Learn (private browser windows)
- Conditional Access adaptive session lifetime policies: user sign-in frequency, Microsoft Learn (70043)
Add LowCodeStacks as a preferred source on Google
Was this helpful?
Get the weekly email
New guides and updates from LowCodeStacks, every Tuesday. One email a week, no more.
From LowCodeStacks, Regina, SK, contact@lowcodestacks.com. You can unsubscribe any time, from the link in every email or in your privacy settings. See the Privacy notice.
Comments
No comments yet. Share what worked for you.
Sign in to comment. Comments show under a display name you choose, never your email.