Entra IDDeep dive

Microsoft Entra AADSTS error codes 50085–54005: the complete list with fixes (part 2 of 5)

Part 2 of the complete AADSTS list: every code from AADSTS50085 to AADSTS54005 in Microsoft's order, with its meaning, the usual cause and the first check.

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 log
  • AADSTS50086 SasNonRetryableError: non-retryable strong authentication errorMicrosoft Entra sign-in log
  • AADSTS50087 SasRetryableError: transient error during strong authenticationMicrosoft Entra sign-in log
  • AADSTS50089: authentication failed because the flow token expiredSign-in page / Microsoft Entra sign-in log
  • AADSTS50097 DeviceAuthenticationRequired: device authentication is requiredMicrosoft Entra sign-in log
  • AADSTS50099 PKeyAuthInvalidJwtUnauthorized: the JWT signature is invalidMicrosoft Entra sign-in log
  • AADSTS50100: error transforming the claims for the tokenSign-in page / Microsoft Entra sign-in log
  • AADSTS50103: error transforming the claims for the token, with detailsSign-in page / Microsoft Entra sign-in log

+ 71 more codes in the tables below.

How this guide is organized: How to read these codes → AADSTS50085 to AADSTS50124 → AADSTS501241 to AADSTS50144 → AADSTS50147 to AADSTS50158 → AADSTS50159 to AADSTS50180 → AADSTS50187 to AADSTS54005 → How to verify a fixFlow diagram of the article's sections in reading order: 1. How to read these codes. 2. AADSTS50085 to AADSTS50124. 3. AADSTS501241 to AADSTS50144. 4. AADSTS50147 to AADSTS50158. 5. AADSTS50159 to AADSTS50180. 6. AADSTS50187 to AADSTS54005. 7. How to verify a fix. Toolbox: AADSTS50085, AADSTS50086, AADSTS50087, dsregcmd /status, Get-MgDomainFederationConfiguration.1How to read thesecodes2AADSTS50085 toAADSTS501243AADSTS501241 toAADSTS501444AADSTS50147 toAADSTS501585AADSTS50159 toAADSTS501806AADSTS50187 toAADSTS540057How to verify a fixTOOLBOXAADSTS50085AADSTS50086AADSTS50087dsregcmd /statusGet-MgDomainFederationConfigurati…How this guide is organized: How to read these codes → AADSTS50085 to AADSTS50124 → AADSTS501241 to AADSTS50144 → AADSTS50147 to AADSTS50158 → AADSTS50159 to AADSTS50180 → AADSTS50187 to AADSTS54005 → How to verify a fixFlow diagram of the article's sections in reading order: 1. How to read these codes. 2. AADSTS50085 to AADSTS50124. 3. AADSTS501241 to AADSTS50144. 4. AADSTS50147 to AADSTS50158. 5. AADSTS50159 to AADSTS50180. 6. AADSTS50187 to AADSTS54005. 7. How to verify a fix. Toolbox: AADSTS50085, AADSTS50086, AADSTS50087, dsregcmd /status, Get-MgDomainFederationConfiguration.1How to read these codes2AADSTS50085 to AADSTS501243AADSTS501241 to AADSTS501444AADSTS50147 to AADSTS501585AADSTS50159 to AADSTS501806AADSTS50187 to AADSTS540057How to verify a fixTOOLBOXAADSTS50085AADSTS50086AADSTS50087dsregcmd /statusGet-MgDomainFederationConfiguration
At a glance: how this guide is organized · 7 sections · 5 key settings and tools

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#

Whether a code from 50085 to 54005 needs action, and whereIs it 50097, 50125, 50140, 50168 or 50199? if Yes: Does a success with the same correlation ID follow? if Yes: An interrupt, not a failure (These normally come before a success; nothing to do); if No: Investigate the interrupt (The SigninLogs query in this section lists interrupts with no success); if No: Is it a PKCE, claims transformation or token-format code? if Yes: Fix the app or its claims configuration (Developer codes aren't fixed in Conditional Access); if No: Look up its meaning and first check (Conditional Access blocks are in the 50187 to 54005 table)Is it 50097, 50125, 50140,50168 or 50199?Does a success with the samecorrelation ID follow?OKAn interrupt, not afailureThese normally comebefore a success; nothingto doYesFIXInvestigate theinterruptThe SigninLogs query in thissection lists interrupts withno successNoYesIs it a PKCE, claimstransformation or token-formatcode?FIXFix the app or its claimsconfigurationDeveloper codes aren'tfixed in Conditional AccessYesNOTELook up its meaningand first checkConditional Access blocksare in the 50187 to 54005tableNoNoWhether a code from 50085 to 54005 needs action, and whereIs it 50097, 50125, 50140, 50168 or 50199? if Yes: Does a success with the same correlation ID follow? if Yes: An interrupt, not a failure (These normally come before a success; nothing to do); if No: Investigate the interrupt (The SigninLogs query in this section lists interrupts with no success); if No: Is it a PKCE, claims transformation or token-format code? if Yes: Fix the app or its claims configuration (Developer codes aren't fixed in Conditional Access); if No: Look up its meaning and first check (Conditional Access blocks are in the 50187 to 54005 table)Is it 50097, 50125, 50140, 50168 or 50199?YesDoes a success with the same correlationID follow?YesOKAn interrupt, not a failureThese normally come before a success; nothingto doNoFIXInvestigate the interruptThe SigninLogs query in this section listsinterrupts with no successNoIs it a PKCE, claims transformation ortoken-format code?YesFIXFix the app or its claims configurationDeveloper codes aren't fixed in ConditionalAccessNoNOTELook up its meaning and first checkConditional Access blocks are in the 50187 to54005 table
Figure 1 · Decision tree Whether a code from 50085 to 54005 needs action, and where. Check for interrupts first, then whether the code is a developer fix; look everything else up in the tables below.
  • 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:

KQL
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 == 0

Related: 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.

CodeMeaningUsual causeFirst check
AADSTS50085Refresh token needs a social identity provider sign-inSocial IdP session can't be refreshed silentlyUser signs in again with username and password
AADSTS50086 SasNonRetryableErrorNon-retryable strong authentication error (no description in Microsoft's table)Not documentedAuthentication Details tab of the entry
AADSTS50087 SasRetryableErrorTransient error during strong authenticationTemporary MFA service conditionRetry
AADSTS50088Limit on telecom MFA calls reachedToo many phone or SMS attemptsAADSTS quick reference
AADSTS50089Authentication failed because the flow token expiredSign-in left unfinished too long; expected lifetimesSign in again
AADSTS50097 DeviceAuthenticationRequiredDevice authentication is requiredInterrupt asking the client for device proofNext entry; dsregcmd /status if none succeeds
AADSTS50098JWT body must contain a required fieldIncomplete JWT from the clientThe field named in the message
AADSTS50099 PKeyAuthInvalidJwtUnauthorizedThe JWT signature is invalid (device proof)Device proof signed with a key Entra ID can't validatedsregcmd /status; device object enabled
AADSTS50100Error transforming the claims for the tokenThe app's claims configurationThe app's claims settings
AADSTS50101Unknown claims transformer specified for the principalPolicy references an unknown transformerClaims mapping policy on the service principal
AADSTS50102Unable to load the CustomClaimsTransformer specified for the principalCustom transformer can't be loadedClaims mapping policy on the service principal
AADSTS50103Error transforming the claims for the token, with detailsTransformation failed at runtimeThe error text; the app's claims settings
AADSTS50105 EntitlementGrantsNotFoundUser isn't assigned to a role for the appAssignment requiredAADSTS quick reference
AADSTS50107Requested federation realm object doesn't existRealm (issuer) in the request matches no federation configurationIssuer from your IdP vs. Get-MgDomainFederationConfiguration
AADSTS50108Claims transformation configuration couldn't be retrievedNot documentedRetry; support case if it persists
AADSTS50109Claim transformation is unknown from configurationTransformation not defined in the policyTransformation IDs in the policy
AADSTS50111Unknown claim transformation was asked to be appliedPolicy calls an undefined transformationTransformation IDs in the policy
AADSTS50117Policy in the request's claims parameter couldn't be deserializedMalformed JSON in the claims parameterThe claims value the app sends
AADSTS50120Unknown credential type, problem with the JWT headerHeader Entra ID can't interpretHow the app builds its JWT
AADSTS50123Unknown claims transformation method specified for the principalUnsupported method nameMethod names in the policy
AADSTS50124Invalid regular expression in the app's claims transformationBad regex patternThe regex in the claims settings

AADSTS501241 to AADSTS50144: credentials, devices, sessions and passwords#

CodeMeaningUsual causeFirst check
AADSTS501241Mandatory input missing from a claims transformation, typically the NameID sourceSAML NameID has no source value for the userSet Unique User Identifier (Name ID) in User Attributes & Claims
AADSTS50125 PasswordResetRegistrationRequiredInterruptSign-in interrupted for password reset or registrationUser must register for or finish a password resetNext entry. SSPR guide
AADSTS50126 InvalidUserNameOrPasswordInvalid username or passwordTypos, a stale password or password spraySmart lockout guide
AADSTS50127 BrokerAppNotInstalledUser must install a broker appAccess needs a broker (Microsoft Authenticator or Company Portal) on the deviceInstall the broker app named in the prompt
AADSTS50128Invalid domain name, no tenant information foundUPN domain not verified in any tenant, or a typoSign-in name vs. your verified domains
AADSTS50129 DeviceIsNotWorkplaceJoinedWorkplace join is required to register the devicePolicy needs a registered deviceRegister the device (Access work or school, or Company Portal)
AADSTS50130Claim value can't be interpreted as a known authentication methodFederated or external provider sends an unrecognized method valueAuthentication method claims your IdP issues
AADSTS50131 ConditionalAccessFailedVarious Conditional Access failuresBad Windows device state, suspicious activity, access or security policyConditional Access tab; device state
AADSTS50132 SsoArtifactInvalidOrExpiredSession invalid after a password expiry or changePassword changed or expiredSign in again. Sign-in frequency guide
AADSTS50133 SsoArtifactRevokedSession invalid after a password expiry or changePassword changed or expiredSign-in frequency guide
AADSTS50134 DeviceFlowAuthorizeWrongDatacenterDevice code flow approved in the wrong data centerApproval and original request in different data centersRestart the device code flow
AADSTS50135 PasswordChangeCompromisedPasswordPassword change required due to account riskID Protection user riskID Protection guide
AADSTS50136 RedirectMsaSessionToAppSingle Microsoft account session detectedPersonal account session sent back to the appInformational unless the flow loops
AADSTS50137Password must change because of a security policy ruleA policy demands a new passwordUser changes it, then signs in
AADSTS50138Invalid encryption key environmentNot documentedRetry; support case
AADSTS50139 SessionMissingMsaOAuth2RefreshTokenSession invalid, external refresh token missingPersonal Microsoft account session lost its tokenSign in again
AADSTS50140 KmsiInterrupt"Keep me signed in" interruptExpected promptSign-in frequency guide
AADSTS50141Protected key isn't intended for the authenticated userNot documentedSign in again; support case if it persists
AADSTS50142Password change required by a Conditional Access policyUser risk policyID Protection guide
AADSTS50143Session mismatch, the user's tenant doesn't match the domain hintDomain hint points to another tenantThe app's domain_hint; support case with the IDs
AADSTS50144 InvalidPasswordExpiredOnPremPasswordActive Directory password has expiredAD password policySSPR 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.

CodeMeaningUsual causeFirst check
AADSTS50147 MissingCodeChallengeInvalid size of the code challenge parameterChallenge missing or wrongly sizedHow the app generates code_challenge
AADSTS50148code_verifier doesn't match the PKCE code_challengeVerifier differs from the one that was hashedThe app's PKCE state handling
AADSTS50146 MissingCustomSigningKeyApp must use an app-specific signing keyClaims mapping on an app without a custom signing key or mapped-claims opt-inSet acceptMappedClaims or add a custom signing key
AADSTS501461AcceptMappedClaims works only for an audience matching the app ID or a verified domainApp ID URI on an unverified domainGUID-based or verified-domain identifier, or a custom signing key
AADSTS501481Code_Verifier doesn't match the code_challengeSame PKCE mismatch as 50148The app's PKCE state handling
AADSTS50149Invalid Code_Challenge_method parameterMethod other than S256 or plainThe method the app sends
AADSTS501491 InvalidCodeChallengeMethodInvalidSizeInvalid size of the Code_Challenge parameterMalformed challengeHow the app encodes it
AADSTS50150Credentials lack valid user consent approval informationNot documentedRetry interactively so the user can consent
AADSTS50155 DeviceAuthenticationFailedDevice authentication failed for this userDevice object deleted, disabled or out of syncPRT guide
AADSTS50156Device tokens aren't supported for V2 resourcesDevice token requested for a V2 resourceToken type and resource the app requests
AADSTS50157User redirection required for routingNot documentedRetry; support case if it repeats
AADSTS50158External security challenge not satisfiedTerms of use or an external MFA providerMFA 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.

CodeMeaningUsual causeFirst check
AADSTS50159Claims sent by the external provider aren't enoughIncomplete response from the providerProvider integration settings and logs
AADSTS50160A different target tenant is preferredNot documentedThe tenant (authority) the app uses
AADSTS50161External claims provider's authorization URL couldn't be validatedWrong or unreachable provider URLThe provider URL configured in Entra ID
AADSTS50162Claims transformation timed outToo many or too complex transformationsSimplify them; a retry may succeed
AADSTS50163Regex replacement made a claim exceed the size limitOutput too largeThe regex and replacement pattern
AADSTS501631Regex replacement made too many replacements in the source claimPattern matches too oftenTighten the regex
AADSTS501632Regex replacement has too many substitution parametersReplacement pattern too complexFewer substitution parameters
AADSTS50164Access token wasn't issued for the purpose it's used forToken reused in another flowRequest a token for the expected purpose
AADSTS50165Requested token encryption algorithm isn't supported for this token typeMisconfigured appThe app's token encryption settings
AADSTS50166Request to an external OIDC endpoint failedProvider unreachable or erroringProvider availability and endpoints
AADSTS50167Invalid pop_jwk keyProof-of-possession request with a bad keyThe library's proof-of-possession setup
AADSTS50168Windows 10 Accounts extension can do SSO, but no valid SSO token was sentInterrupt to fetch an SSO tokenNext entry; if it repeats, the PRT guide
AADSTS50169 InvalidRequestBadRealmRealm isn't configured in the current service namespaceRealm doesn't match the app's identifierIdentifier (Entity ID) vs. the realm sent
AADSTS50170 MissingExternalClaimsProviderMappingExternal controls mapping is missingIncomplete external control or provider setupCustom controls and provider settings
AADSTS50171Audience usable only in mutual-TLS token callsToken request without mutual TLSHow the client authenticates
AADSTS50172External claims provider isn't approvedProvider not approved in the tenantProvider registration and consent
AADSTS50173Grant revoked, a fresh auth token is neededPassword changed or sessions revokedSign-in frequency guide
AADSTS50176Missing definition of an external controlPolicy references an undefined controlControl ID in the message vs. your custom controls
AADSTS50177 ExternalChallengeNotSupportedForPassthroughUsersExternal challenge not supported for passthrough usersExternal control applied to a passthrough accountPolicy scope for passthrough users
AADSTS50178 SessionControlNotSupportedForPassthroughUsersSession control not supported for passthrough usersSession control applied to a passthrough accountPolicy scope for passthrough users
AADSTS50180 WindowsIntegratedAuthMissingIntegrated Windows authentication is neededSeamless SSO not enabled for the tenantSeamless SSO guide

AADSTS50187 to AADSTS54005: device information, Conditional Access and authorization codes#

CodeMeaningUsual causeFirst check
AADSTS50187 DeviceInformationNotProvidedService failed to perform device authenticationNo usable device information from the clientdsregcmd /status
AADSTS50192 RawCredentialExpectedNotFoundNo credential in the sign-in requestNo certificate sent during CBA, or a proxy removed itCBA errors guide
AADSTS50194App isn't multitenant, so /common isn't supportedSingle-tenant app on the common endpointAADSTS quick reference
AADSTS50196 LoopDetectedClient loop detectedApp repeats requests without caching tokensAADSTS quick reference
AADSTS50197 ConflictingIdentitiesThe user couldn't be foundNot documented beyond the nameRetry; look for objects sharing the sign-in name
AADSTS50199 CmsiInterruptUser confirmation required for security reasonsNative app using a system webview with a redirect URI outside the safe listNo action; developers can use an http, https or chrome-extension redirect URI
AADSTS51000 RequiredFeatureNotEnabledThe feature is disabledNot documentedSupport case with the correlation ID
AADSTS51001 DomainHintMustbePresentDomain hint required with an on-premises SID or UPNOn-premises identifiers sent without domain_hintParameters the app or IdP sends
AADSTS1000104 XCB2BResourceCloudNotAllowedOnIdentityTenantResource cloud not allowed for the user's identity tenantB2B between Microsoft clouds not enabledBoth tenants enable the other cloud in Microsoft cloud settings and add each other
AADSTS51004 UserAccountNotInDirectoryUser account doesn't exist in the directoryWrong tenant, or the user was never addedAdd as a guest if intended. Guest guide
AADSTS51005 TemporaryRedirectEquivalent to HTTP 307: follow the Location headerNormal redirectClient follows it, keeping POST
AADSTS51006 ForceReauthDueToInsufficientAuthIntegrated Windows authentication is needed; the session lacks the claimSession token without the Windows-integrated claimUser signs in again
AADSTS52004 DelegationDoesNotExistForLinkedInUser hasn't consented to LinkedIn resourcesLinkedIn account connection not approvedUser consent; LinkedIn account connections setting
AADSTS53000 DeviceNotCompliantPolicy requires a compliant deviceDevice not enrolled or not compliantConditional Access blocks guide
AADSTS53001 DeviceNotDomainJoinedPolicy requires a domain-joined deviceDevice isn't hybrid joinedConditional Access blocks guide
AADSTS53002 ApplicationUsedIsNotAnApprovedAppApp isn't approved for Conditional AccessPolicy requires an approved client appGrant controls on the Conditional Access tab
AADSTS53003 BlockedByConditionalAccessPolicy doesn't allow token issuanceA Block grant matchedConditional Access blocks guide
AADSTS530035 BlockedBySecurityDefaultsBlocked by security defaultsLegacy authentication or an unsafe requestAADSTS quick reference
AADSTS53004 ProofUpBlockedDueToRiskMFA registration needed but blocked by riskRisky session tried to registerMFA errors guide
AADSTS53010 ProofUpBlockedDueToSecurityInfoAcrMFA methods can't be set up from this location or devicePolicy on the Register security information user actionThat policy's conditions. MFA errors guide
AADSTS53011User blocked due to risk on home tenantGuest flagged as risky by their organizationID Protection guide
AADSTS530034 DelegatedAdminBlockedDueToSuspiciousActivityDelegated admin blocked due to account risk in their home tenantPartner admin account flagged as riskyThe partner tenant remediates the risk
AADSTS54000 MinorUserBlockedLegalAgeGroupRuleMinor blocked by the legal age group rule (no description in Microsoft's table)Account classified as a minor without consentageGroup and consentProvidedForMinor
AADSTS54005OAuth2 authorization code was already redeemedApp redeemed the same code twiceA new code, or the existing refresh token

How to verify a fix#

  1. 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.
  2. For interrupts, run the query above again; the correlation ID should now include a success.
  3. For Conditional Access codes (50131, 53002, 53010), the entry's Conditional Access tab should no longer show a failed policy.
  4. For 50146 and 501461, confirm the app's identifier and mapped-claims setting, then sign in again:
PowerShell
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.

References#

Written and checked against current Microsoft Learn documentation. Test changes with a pilot group before rolling them out to everyone, and if an admin center path has moved since, search for the setting name instead.

Spotted a mistake, or did this fix work differently for you? Email me or message me on LinkedIn — corrections are credited in the article.

Written by

Omer Eltayeb

M365 Subject Matter Expert, former Microsoft Cloud Solutions Architect, Microsoft Certified Trainer and Microsoft Innovative Educator Expert (2024–26) and Microsoft Elevate Educator Expert (2026–27). I share practical, step-by-step guides, study plans, scripts and toolkits for Microsoft Intune, Configuration Manager, Microsoft Entra ID, Microsoft Defender, Exchange and Microsoft 365 with the community.

Microsoft Certified Trainer (MCT) 2026Microsoft Innovative Educator Expert 2025–2026Microsoft Elevate Educator Expert 2026–2027ISC2 Certified Information Systems Security Professional (CISSP)Microsoft 365 Certified: Enterprise Administrator Expert (MS-102)