Part 2 of the complete AADSTS reference covers the longest stretch of Microsoft's table: all 99 codes from AADSTS50085 to AADSTS54005, in Microsoft's order. It spans MFA service errors, device proof, claims transformations, PKCE, external providers and the core Conditional Access blocks, each with a plain-English meaning, the usual cause and the first check.
Codes in this quick reference
AADSTS50085: refresh token needs a social identity provider sign-inSign-in page / Microsoft Entra sign-in logAADSTS50086 SasNonRetryableError: non-retryable strong authentication errorMicrosoft Entra sign-in logAADSTS50087 SasRetryableError: transient error during strong authenticationMicrosoft Entra sign-in logAADSTS50089: authentication failed because the flow token expiredSign-in page / Microsoft Entra sign-in logAADSTS50097 DeviceAuthenticationRequired: device authentication is requiredMicrosoft Entra sign-in logAADSTS50099 PKeyAuthInvalidJwtUnauthorized: the JWT signature is invalidMicrosoft Entra sign-in logAADSTS50100: error transforming the claims for the tokenSign-in page / Microsoft Entra sign-in logAADSTS50103: error transforming the claims for the token, with detailsSign-in page / Microsoft Entra sign-in log
+ 71 more codes in the tables below.
Note: The series covers Microsoft's whole AADSTS table: part 1 (16000–50079), part 2 (50085–54005, this page), part 3 (65001–81012), part 4 (90002–90130) and part 5 (120000 and above). Codes with a detailed guide on this site link to it.
How to read these codes#
- Where they appear: the sign-in page (with a correlation ID), Entra ID › Monitoring & health › Sign-in logs (the error code without the prefix) and the token endpoint's JSON for apps and scripts. For Microsoft's current wording, add the number to
https://login.microsoftonline.com/error?code=. - Interrupts: 50097, 50125, 50140, 50168 and 50199 normally precede a success with the same correlation ID. Investigate only when no success follows.
- Developer codes: PKCE, claims transformation and token-format codes are fixed in the app or its claims configuration, not in Conditional Access.
This query lists sign-ins where an interrupt never turned into a success:
let interrupts = dynamic(["50097", "50125", "50140", "50168", "50199"]);
SigninLogs
| where TimeGenerated > ago(1d)
| summarize Codes = make_set(ResultType), Successes = countif(ResultType == "0")
by CorrelationId, UserPrincipalName, AppDisplayName
| where array_length(set_intersect(Codes, interrupts)) > 0 and Successes == 0Related: the AADSTS quick reference (common codes by area), the Intune and Jamf AADSTS reference and the device registration error codes.
AADSTS50085 to AADSTS50124: MFA service, device proof and claims transformations#
Claims codes point at the app's claims configuration: Entra ID › Enterprise apps › your app › Single sign-on › User Attributes & Claims, or a claims mapping policy set through Microsoft Graph.
| Code | Meaning | Usual cause | First check |
|---|---|---|---|
AADSTS50085 | Refresh token needs a social identity provider sign-in | Social IdP session can't be refreshed silently | User signs in again with username and password |
AADSTS50086 SasNonRetryableError | Non-retryable strong authentication error (no description in Microsoft's table) | Not documented | Authentication Details tab of the entry |
AADSTS50087 SasRetryableError | Transient error during strong authentication | Temporary MFA service condition | Retry |
AADSTS50088 | Limit on telecom MFA calls reached | Too many phone or SMS attempts | AADSTS quick reference |
AADSTS50089 | Authentication failed because the flow token expired | Sign-in left unfinished too long; expected lifetimes | Sign in again |
AADSTS50097 DeviceAuthenticationRequired | Device authentication is required | Interrupt asking the client for device proof | Next entry; dsregcmd /status if none succeeds |
AADSTS50098 | JWT body must contain a required field | Incomplete JWT from the client | The field named in the message |
AADSTS50099 PKeyAuthInvalidJwtUnauthorized | The JWT signature is invalid (device proof) | Device proof signed with a key Entra ID can't validate | dsregcmd /status; device object enabled |
AADSTS50100 | Error transforming the claims for the token | The app's claims configuration | The app's claims settings |
AADSTS50101 | Unknown claims transformer specified for the principal | Policy references an unknown transformer | Claims mapping policy on the service principal |
AADSTS50102 | Unable to load the CustomClaimsTransformer specified for the principal | Custom transformer can't be loaded | Claims mapping policy on the service principal |
AADSTS50103 | Error transforming the claims for the token, with details | Transformation failed at runtime | The error text; the app's claims settings |
AADSTS50105 EntitlementGrantsNotFound | User isn't assigned to a role for the app | Assignment required | AADSTS quick reference |
AADSTS50107 | Requested federation realm object doesn't exist | Realm (issuer) in the request matches no federation configuration | Issuer from your IdP vs. Get-MgDomainFederationConfiguration |
AADSTS50108 | Claims transformation configuration couldn't be retrieved | Not documented | Retry; support case if it persists |
AADSTS50109 | Claim transformation is unknown from configuration | Transformation not defined in the policy | Transformation IDs in the policy |
AADSTS50111 | Unknown claim transformation was asked to be applied | Policy calls an undefined transformation | Transformation IDs in the policy |
AADSTS50117 | Policy in the request's claims parameter couldn't be deserialized | Malformed JSON in the claims parameter | The claims value the app sends |
AADSTS50120 | Unknown credential type, problem with the JWT header | Header Entra ID can't interpret | How the app builds its JWT |
AADSTS50123 | Unknown claims transformation method specified for the principal | Unsupported method name | Method names in the policy |
AADSTS50124 | Invalid regular expression in the app's claims transformation | Bad regex pattern | The regex in the claims settings |
AADSTS501241 to AADSTS50144: credentials, devices, sessions and passwords#
| Code | Meaning | Usual cause | First check |
|---|---|---|---|
AADSTS501241 | Mandatory input missing from a claims transformation, typically the NameID source | SAML NameID has no source value for the user | Set Unique User Identifier (Name ID) in User Attributes & Claims |
AADSTS50125 PasswordResetRegistrationRequiredInterrupt | Sign-in interrupted for password reset or registration | User must register for or finish a password reset | Next entry. SSPR guide |
AADSTS50126 InvalidUserNameOrPassword | Invalid username or password | Typos, a stale password or password spray | Smart lockout guide |
AADSTS50127 BrokerAppNotInstalled | User must install a broker app | Access needs a broker (Microsoft Authenticator or Company Portal) on the device | Install the broker app named in the prompt |
AADSTS50128 | Invalid domain name, no tenant information found | UPN domain not verified in any tenant, or a typo | Sign-in name vs. your verified domains |
AADSTS50129 DeviceIsNotWorkplaceJoined | Workplace join is required to register the device | Policy needs a registered device | Register the device (Access work or school, or Company Portal) |
AADSTS50130 | Claim value can't be interpreted as a known authentication method | Federated or external provider sends an unrecognized method value | Authentication method claims your IdP issues |
AADSTS50131 ConditionalAccessFailed | Various Conditional Access failures | Bad Windows device state, suspicious activity, access or security policy | Conditional Access tab; device state |
AADSTS50132 SsoArtifactInvalidOrExpired | Session invalid after a password expiry or change | Password changed or expired | Sign in again. Sign-in frequency guide |
AADSTS50133 SsoArtifactRevoked | Session invalid after a password expiry or change | Password changed or expired | Sign-in frequency guide |
AADSTS50134 DeviceFlowAuthorizeWrongDatacenter | Device code flow approved in the wrong data center | Approval and original request in different data centers | Restart the device code flow |
AADSTS50135 PasswordChangeCompromisedPassword | Password change required due to account risk | ID Protection user risk | ID Protection guide |
AADSTS50136 RedirectMsaSessionToApp | Single Microsoft account session detected | Personal account session sent back to the app | Informational unless the flow loops |
AADSTS50137 | Password must change because of a security policy rule | A policy demands a new password | User changes it, then signs in |
AADSTS50138 | Invalid encryption key environment | Not documented | Retry; support case |
AADSTS50139 SessionMissingMsaOAuth2RefreshToken | Session invalid, external refresh token missing | Personal Microsoft account session lost its token | Sign in again |
AADSTS50140 KmsiInterrupt | "Keep me signed in" interrupt | Expected prompt | Sign-in frequency guide |
AADSTS50141 | Protected key isn't intended for the authenticated user | Not documented | Sign in again; support case if it persists |
AADSTS50142 | Password change required by a Conditional Access policy | User risk policy | ID Protection guide |
AADSTS50143 | Session mismatch, the user's tenant doesn't match the domain hint | Domain hint points to another tenant | The app's domain_hint; support case with the IDs |
AADSTS50144 InvalidPasswordExpiredOnPremPassword | Active Directory password has expired | AD password policy | SSPR and writeback guide |
AADSTS50147 to AADSTS50158: PKCE, signing keys and device tokens#
PKCE codes are developer fixes: the app sends a code_challenge with the authorization request and the matching code_verifier when it redeems the code. Microsoft's table lists 50147 twice; both entries describe an invalid code challenge.
| Code | Meaning | Usual cause | First check |
|---|---|---|---|
AADSTS50147 MissingCodeChallenge | Invalid size of the code challenge parameter | Challenge missing or wrongly sized | How the app generates code_challenge |
AADSTS50148 | code_verifier doesn't match the PKCE code_challenge | Verifier differs from the one that was hashed | The app's PKCE state handling |
AADSTS50146 MissingCustomSigningKey | App must use an app-specific signing key | Claims mapping on an app without a custom signing key or mapped-claims opt-in | Set acceptMappedClaims or add a custom signing key |
AADSTS501461 | AcceptMappedClaims works only for an audience matching the app ID or a verified domain | App ID URI on an unverified domain | GUID-based or verified-domain identifier, or a custom signing key |
AADSTS501481 | Code_Verifier doesn't match the code_challenge | Same PKCE mismatch as 50148 | The app's PKCE state handling |
AADSTS50149 | Invalid Code_Challenge_method parameter | Method other than S256 or plain | The method the app sends |
AADSTS501491 InvalidCodeChallengeMethodInvalidSize | Invalid size of the Code_Challenge parameter | Malformed challenge | How the app encodes it |
AADSTS50150 | Credentials lack valid user consent approval information | Not documented | Retry interactively so the user can consent |
AADSTS50155 DeviceAuthenticationFailed | Device authentication failed for this user | Device object deleted, disabled or out of sync | PRT guide |
AADSTS50156 | Device tokens aren't supported for V2 resources | Device token requested for a V2 resource | Token type and resource the app requests |
AADSTS50157 | User redirection required for routing | Not documented | Retry; support case if it repeats |
AADSTS50158 | External security challenge not satisfied | Terms of use or an external MFA provider | MFA errors guide |
AADSTS50159 to AADSTS50180: external providers, claims limits and passthrough users#
Several codes here involve external providers that Entra ID calls during sign-in, such as third-party MFA integrations. The regex codes come from regex-based claims transformations.
| Code | Meaning | Usual cause | First check |
|---|---|---|---|
AADSTS50159 | Claims sent by the external provider aren't enough | Incomplete response from the provider | Provider integration settings and logs |
AADSTS50160 | A different target tenant is preferred | Not documented | The tenant (authority) the app uses |
AADSTS50161 | External claims provider's authorization URL couldn't be validated | Wrong or unreachable provider URL | The provider URL configured in Entra ID |
AADSTS50162 | Claims transformation timed out | Too many or too complex transformations | Simplify them; a retry may succeed |
AADSTS50163 | Regex replacement made a claim exceed the size limit | Output too large | The regex and replacement pattern |
AADSTS501631 | Regex replacement made too many replacements in the source claim | Pattern matches too often | Tighten the regex |
AADSTS501632 | Regex replacement has too many substitution parameters | Replacement pattern too complex | Fewer substitution parameters |
AADSTS50164 | Access token wasn't issued for the purpose it's used for | Token reused in another flow | Request a token for the expected purpose |
AADSTS50165 | Requested token encryption algorithm isn't supported for this token type | Misconfigured app | The app's token encryption settings |
AADSTS50166 | Request to an external OIDC endpoint failed | Provider unreachable or erroring | Provider availability and endpoints |
AADSTS50167 | Invalid pop_jwk key | Proof-of-possession request with a bad key | The library's proof-of-possession setup |
AADSTS50168 | Windows 10 Accounts extension can do SSO, but no valid SSO token was sent | Interrupt to fetch an SSO token | Next entry; if it repeats, the PRT guide |
AADSTS50169 InvalidRequestBadRealm | Realm isn't configured in the current service namespace | Realm doesn't match the app's identifier | Identifier (Entity ID) vs. the realm sent |
AADSTS50170 MissingExternalClaimsProviderMapping | External controls mapping is missing | Incomplete external control or provider setup | Custom controls and provider settings |
AADSTS50171 | Audience usable only in mutual-TLS token calls | Token request without mutual TLS | How the client authenticates |
AADSTS50172 | External claims provider isn't approved | Provider not approved in the tenant | Provider registration and consent |
AADSTS50173 | Grant revoked, a fresh auth token is needed | Password changed or sessions revoked | Sign-in frequency guide |
AADSTS50176 | Missing definition of an external control | Policy references an undefined control | Control ID in the message vs. your custom controls |
AADSTS50177 ExternalChallengeNotSupportedForPassthroughUsers | External challenge not supported for passthrough users | External control applied to a passthrough account | Policy scope for passthrough users |
AADSTS50178 SessionControlNotSupportedForPassthroughUsers | Session control not supported for passthrough users | Session control applied to a passthrough account | Policy scope for passthrough users |
AADSTS50180 WindowsIntegratedAuthMissing | Integrated Windows authentication is needed | Seamless SSO not enabled for the tenant | Seamless SSO guide |
AADSTS50187 to AADSTS54005: device information, Conditional Access and authorization codes#
| Code | Meaning | Usual cause | First check |
|---|---|---|---|
AADSTS50187 DeviceInformationNotProvided | Service failed to perform device authentication | No usable device information from the client | dsregcmd /status |
AADSTS50192 RawCredentialExpectedNotFound | No credential in the sign-in request | No certificate sent during CBA, or a proxy removed it | CBA errors guide |
AADSTS50194 | App isn't multitenant, so /common isn't supported | Single-tenant app on the common endpoint | AADSTS quick reference |
AADSTS50196 LoopDetected | Client loop detected | App repeats requests without caching tokens | AADSTS quick reference |
AADSTS50197 ConflictingIdentities | The user couldn't be found | Not documented beyond the name | Retry; look for objects sharing the sign-in name |
AADSTS50199 CmsiInterrupt | User confirmation required for security reasons | Native app using a system webview with a redirect URI outside the safe list | No action; developers can use an http, https or chrome-extension redirect URI |
AADSTS51000 RequiredFeatureNotEnabled | The feature is disabled | Not documented | Support case with the correlation ID |
AADSTS51001 DomainHintMustbePresent | Domain hint required with an on-premises SID or UPN | On-premises identifiers sent without domain_hint | Parameters the app or IdP sends |
AADSTS1000104 XCB2BResourceCloudNotAllowedOnIdentityTenant | Resource cloud not allowed for the user's identity tenant | B2B between Microsoft clouds not enabled | Both tenants enable the other cloud in Microsoft cloud settings and add each other |
AADSTS51004 UserAccountNotInDirectory | User account doesn't exist in the directory | Wrong tenant, or the user was never added | Add as a guest if intended. Guest guide |
AADSTS51005 TemporaryRedirect | Equivalent to HTTP 307: follow the Location header | Normal redirect | Client follows it, keeping POST |
AADSTS51006 ForceReauthDueToInsufficientAuth | Integrated Windows authentication is needed; the session lacks the claim | Session token without the Windows-integrated claim | User signs in again |
AADSTS52004 DelegationDoesNotExistForLinkedIn | User hasn't consented to LinkedIn resources | LinkedIn account connection not approved | User consent; LinkedIn account connections setting |
AADSTS53000 DeviceNotCompliant | Policy requires a compliant device | Device not enrolled or not compliant | Conditional Access blocks guide |
AADSTS53001 DeviceNotDomainJoined | Policy requires a domain-joined device | Device isn't hybrid joined | Conditional Access blocks guide |
AADSTS53002 ApplicationUsedIsNotAnApprovedApp | App isn't approved for Conditional Access | Policy requires an approved client app | Grant controls on the Conditional Access tab |
AADSTS53003 BlockedByConditionalAccess | Policy doesn't allow token issuance | A Block grant matched | Conditional Access blocks guide |
AADSTS530035 BlockedBySecurityDefaults | Blocked by security defaults | Legacy authentication or an unsafe request | AADSTS quick reference |
AADSTS53004 ProofUpBlockedDueToRisk | MFA registration needed but blocked by risk | Risky session tried to register | MFA errors guide |
AADSTS53010 ProofUpBlockedDueToSecurityInfoAcr | MFA methods can't be set up from this location or device | Policy on the Register security information user action | That policy's conditions. MFA errors guide |
AADSTS53011 | User blocked due to risk on home tenant | Guest flagged as risky by their organization | ID Protection guide |
AADSTS530034 DelegatedAdminBlockedDueToSuspiciousActivity | Delegated admin blocked due to account risk in their home tenant | Partner admin account flagged as risky | The partner tenant remediates the risk |
AADSTS54000 MinorUserBlockedLegalAgeGroupRule | Minor blocked by the legal age group rule (no description in Microsoft's table) | Account classified as a minor without consent | ageGroup and consentProvidedForMinor |
AADSTS54005 | OAuth2 authorization code was already redeemed | App redeemed the same code twice | A new code, or the existing refresh token |
How to verify a fix#
- Reproduce with the same user, app and client, then open the new sign-in log entry: success or a different code means the cause is gone.
- For interrupts, run the query above again; the correlation ID should now include a success.
- For Conditional Access codes (50131, 53002, 53010), the entry's Conditional Access tab should no longer show a failed policy.
- For 50146 and 501461, confirm the app's identifier and mapped-claims setting, then sign in again:
Connect-MgGraph -Scopes "Application.Read.All"
Get-MgApplication -Filter "appId eq '00001111-aaaa-2222-bbbb-3333cccc4444'" -Property displayName,identifierUris,api |
Select-Object DisplayName, IdentifierUris, @{n='AcceptMappedClaims';e={$_.Api.AcceptMappedClaims}}Where Microsoft documents no cause (50108, 50138, 50141, 51000), open a support case with the correlation ID, request ID and timestamp.

