LowCodeStacks™
Sign in

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

Checked against Microsoft Learn 17 sources · Updated By · drafted with AI help, checked by a personHow we write guides

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.

AADSTS sign-in error codes grouped by what is wrong, each group with its usual fix. The app registration, codes 50011, 700016, 500011, 65005 and 70011: fix the exact redirect URL, client ID, tenant, resource or scope. Consent and assignment, codes 65001, 90094, 65004 and 50105: the person consents, or an admin grants consent, and the person is assigned in Users and groups. The app's credential, codes 7000215, 7000222, 7000218 and 700027: create a new secret and copy its Value at once, or upload the certificate. The person signing in, codes 50126, 50034, 50020, 50053, 50055 and 50057: a wrong account or tenant, or an account that is locked, expired or disabled, which the person or an admin fixes. MFA and Conditional Access, codes 50076, 50079, 53003 and 50158: sign in interactively, and a script needs a managed or workload identity. Federated credentials for pipelines, codes 70021, 700211, 700213 and 70025: the issuer and subject must match the federated credential exactly. Any code can be pasted at login.microsoftonline.com/error for Microsoft's own explanation.
The common AADSTS codes fall into six groups by what is wrong, and each group has one usual fix.

The app registration

CodeWhat it meansFix
AADSTS50011The redirect (reply) URL in the request doesn't match any configured on the app registrationCopy 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
AADSTS700016The application (client ID) wasn't found in this tenantThe 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
AADSTS500011The resource (the API you're asking a token for) has no service principal in this tenantThe 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
AADSTS50001The resource is disabled or doesn't existUse the exact resource identifier or scope (https://graph.microsoft.com/.default, api://<client-id>/.default)
AADSTS65005The app asks for a resource that isn't in its required permissions list, or a SAML app has the wrong IdentifierAdd the permission under API permissions, or fix the SAML Identifier (Entity ID)
AADSTS70011The scope requested is invalidScopes are <resource>/<permission> or <resource>/.default; check for typos and the right resource
AADSTS90002The tenant name wasn't foundThe tenant ID or domain is wrong, often an app from one cloud (public, Government, China) pointed at another
AADSTS9002313The request is malformedA missing or misencoded parameter; capture the request and compare it with the protocol documentation
CodeWhat it meansFix
AADSTS65001Nobody has consented to this app using that permissionSend an interactive sign-in so the person can consent, or an admin grants admin consent on the app's API permissions
AADSTS90094The 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 consentAn 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
AADSTS65004The 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 appAsk them to sign in again and accept, or an admin consents for everyone (or approves the pending request)
AADSTS50105The app requires user assignment and this person isn't assignedIn Enterprise apps > All applications > the app > Users and groups, assign them, or turn off Assignment required

The app's credential

CodeWhat it meansFix
AADSTS7000215The client secret is wrongYou 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
AADSTS7000222The client secret has expiredCreate a new secret; consider a certificate or a federated credential instead, which don't leak the same way
AADSTS7000218The request has no client_secret or client_assertionThe 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
AADSTS700027The client assertion failed signature validation, for example because the certificate it was signed with has expired or isn't the one registeredUpload a current certificate under Certificates & secrets, and check the thumbprint the app signs with
AADSTS54005The authorization code has already been redeemedA 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
AADSTS70000The refresh token isn't valid; Microsoft names token binding (an empty header, or a hash that doesn't match) as the reasonsSign in again for a new token
AADSTS700082The refresh token expired through inactivityNormal: the person hasn't used the app in a long time; sign in again
AADSTS50173The grant has expired because it was revoked, usually after the password was changed or resetSign in again with a fresh token

The person signing in

CodeWhat it meansFix
AADSTS50126Wrong username or passwordExpect some of these from mistyped passwords; the person signs in again with the right one, or resets it
AADSTS50034The account isn't in this tenantThe person typed the wrong name, or the app chose the wrong tenant; if they should be in, add them as a guest
AADSTS51004The account doesn't exist in the directory the app signed in to; usually the app picked the wrong tenantPoint the app at the right tenant. If the person should have access to this one, add them as a guest
AADSTS50020The account from another identity provider isn't a user in this tenantAdd them as an external (guest) user first, or have them sign in with the right account
AADSTS50053The account is locked after repeated failed sign-ins, or the sign-in came from a blocked IPWait, or an admin unblocks in ID Protection
AADSTS50055The password has expiredThe person resets it, or an admin does
AADSTS50057The account is disabledAn admin re-enables it, in Entra or in on-premises Active Directory if it's synced
AADSTS50058No signed-in session for silent sign-inExpected when nobody is signed in; the app should fall back to an interactive sign-in
AADSTS50059 / 50128No tenant information in the request or the credentialsPass the tenant ID or a verified domain

MFA and Conditional Access

CodeWhat it meansFix
AADSTS50076MFA is required by a Conditional Access policy, per-user MFA or a new locationRetry 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)
AADSTS50072The 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
AADSTS50079MFA is now required (a Conditional Access policy, per-user MFA or a new location) and the person hasn't set it upA cloud account registers its security information at aka.ms/mysecurityinfo; a federated account gets the MFA claim from its own identity provider
AADSTS50074The MFA challenge wasn't passedTry again; check the authentication methods registered
AADSTS50097Device 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 onSign 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
AADSTS70043The refresh token has expired, or isn't valid, because of a Conditional Access sign-in frequency checkExpected 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
AADSTS53003A Conditional Access policy blocked the sign-inOpen 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)
AADSTS50158An external challenge (terms of use, a third-party MFA provider) must be satisfiedNot a failure by itself; the person is being redirected to complete it
AADSTS90072An external account can't satisfy this tenant's MFA, or a synced account's anchor doesn't matchAdd the account as an external user, or fix the ImmutableID mismatch between Active Directory and Entra

Federated credentials for pipelines

CodeWhat it meansFix
AADSTS70021No federated identity credential matches the token the pipeline presented: issuer or subject differsCompare 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
AADSTS700211No credential matches the issuerFix the issuer. Azure DevOps's new issuer is https://login.microsoftonline.com/<tenant id>/v2.0; GitHub's is https://token.actions.githubusercontent.com
AADSTS700213No credential matches the subjectFix 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
AADSTS70025The app has no federated credentials at allAdd one in the app's Certificates & secrets, on its federated credentials tab
AADSTS700223Workload identity federation is disabled or constrained on the tenantAsk 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:

  1. 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.
  2. Selecting a sign-in opens Activity Details: Sign-ins on the Basic info tab.
  3. Sign-in error code shows the code without the prefix: 50011 here is AADSTS50011.
  4. 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.
  5. Investigate with Copilot (a preview) and Launch the Sign-in Diagnostic. start Microsoft's own troubleshooting for this sign-in.
The Microsoft Entra admin center's Sign-in events page, with a banner offering to switch back to the legacy sign-in logs experience, filter chips Add filter, Show dates as: UTC, Date range: Last 24 hours and Status : Failure, and the User sign-ins (interactive) tab listing failed sign-ins by date, request ID, user principal name and application, several of them for admin@lowcodestacks.com in the app LowCodeStacks Expenses. On the right, the Activity Details: Sign-ins pane is open on Basic info, with tabs Location, Device info, Authentication details, Conditional access and Report only. It shows Date 2026-10-20T14:32:08Z, made-up request and correlation IDs, Is Agent No, Agent type and Agent subject type Not Agentic, Authentication requirement Single-factor authentication, Status Failure, Continuous access evaluation No, Sign-in error code 50011, and Failure reason: The redirect URI 'https://expenses.lowcodestacks.com/signin-oidc' specified in the request does not match the redirect URIs configured for the application '00001111-aaaa-2222-bbbb-3333cccc4444'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this. Additional details: Developer error - the app is attempting to sign in without the necessary or correct authentication parameters. Below are an Investigate with Copilot button under Troubleshoot with AI, and the link Launch the Sign-in Diagnostic. under Troubleshoot event.
Recreated by LowCodeStacks from Microsoft Learn screenshots (CC BY 4.0): a failed sign-in's Activity Details pane in the Microsoft Entra admin center sign-in logs, interface as of April 2026, with made-up data.

Sources

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.