Entra ID sign-in error
AADSTS50034: User account not found in the directory
AADSTS50034 means the account does not exist in the tenant the sign-in went to. Typos, the wrong tenant and sync problems, and how to fix each.
AADSTS50034
To sign into this application, the account must be added to the directory.
What it means
The account does not exist in the tenant the sign-in went to. Usually the username was mistyped, the person is not in that tenant, or the app sent the sign-in to the wrong tenant. On hybrid devices it can also mean the on-premises account is not syncing to Microsoft Entra ID.
Fix it: tenant admins
- If the person should have access and belongs to another organisation, invite them as a guest:
Entra ID > Users > New user > Invite external user, as at least User Administrator. - Hybrid devices: check the user enters their correct UPN and that the on-premises account is syncing to Microsoft Entra ID.
Fix it: app developers
- Check the app sends the sign-in to the right tenant: an app that picks the wrong tenant gets this error for users who exist only elsewhere.
Fix it: the person signing in
- Check the username you typed for typos and try again.
- Check you are using the account this organisation gave you, not a personal account or one from another organisation.
Related codes
Microsoft sources
Find who is hitting AADSTS50034
Sign-in logs record the code without the AADSTS prefix: as status/errorCode in Microsoft Graph S04 and as ResultType in the SigninLogs table in Log Analytics S05. The SigninLogs and Microsoft Graph queries below cover interactive sign-ins. Non-interactive sign-ins are in the AADNonInteractiveUserSignInLogs table, which documents the error code in ResultSignature S41. If you query that table, test ResultType as well. For one failed sign-in, paste its error message into the lookup to get queries for its Correlation ID.
Log Analytics (KQL), last 7 days
SigninLogs
| where TimeGenerated > ago(7d) and ResultType == "50034"
| summarize Failures = count(), Last = max(TimeGenerated) by UserPrincipalName, AppDisplayName
| sort by Failures descMicrosoft Graph PowerShell, last 7 days
Connect-MgGraph -Scopes "AuditLog.Read.All"
$since = (Get-Date).ToUniversalTime().AddDays(-7).ToString("yyyy-MM-ddTHH:mm:ssZ")
Get-MgAuditLogSignIn -Filter "status/errorCode eq 50034 and createdDateTime ge $since" -All |
Select-Object CreatedDateTime, UserPrincipalName, AppDisplayName, CorrelationIdReading sign-in logs needs at least the Reports Reader role S06; the Graph call needs the AuditLog.Read.All permission S42, and -All returns every page of results S69.
Sources for this page
Microsoft's description is quoted from the Microsoft Entra error code reference; it is Microsoft's text and is not covered by our CC BY 4.0 licence. The cause and fix steps are our own wording, published under CC BY 4.0; each source below is the Microsoft page they rest on, with the passage we checked. Rules for every page are in the methodology.
S01. Microsoft (Microsoft Learn), Microsoft Entra authentication and authorization error codes. Retrieved 2026-11-25.
An application might have chosen the wrong tenant to sign into, and the currently logged in user was prevented from doing so since they did not exist in your tenant.
Error codes are subject to change at any time in order to provide more granular error messages
Error codes and messages are subject to change. For the most current info, take a look at the
You can also link directly to a specific error by adding the error code number to the URL
S50. Microsoft (Microsoft Learn, Microsoft Entra External ID), Add B2B collaboration users. Retrieved 2026-11-25.
Sign in to the Microsoft Entra admin center as at least a User Administrator.
Select New user > Invite external user from the menu.
S51. Microsoft (Microsoft Learn), Troubleshoot primary refresh token issues on Windows devices. Retrieved 2026-11-25.
Make sure that the user is entering the correct UPN.
Make sure that the on-premises user account is being synchronized to Microsoft Entra ID.
S52. Microsoft (Microsoft Learn), Acquire a token to call a web API using username and password (desktop app). Retrieved 2026-11-25.
Mitigation: ask the user to re-enter the username.
S04. Microsoft (Microsoft Learn, Microsoft Graph), signIn resource type. Retrieved 2026-11-25.
Supports $filter (eq) on errorCode property.
The request ID sent from the client when the sign-in is initiated. Used to troubleshoot sign-in activity.
S05. Microsoft (Microsoft Learn, Azure Monitor), Azure Monitor Logs reference - SigninLogs. Retrieved 2026-11-25.
Provides the 5-6 digit error code that's generated during a sign-in event. 0 indicates success; other values are failures.
The identifier that's sent from the client when sign-in is initiated.
S06. Microsoft (Microsoft Learn), How to troubleshoot sign-in errors. Retrieved 2026-11-25.
Reports Reader is the least privileged role required to access the activity logs.
any user can access their own sign-ins from https://mysignins.microsoft.com.
S41. Microsoft (Microsoft Learn, Azure Monitor), Azure Monitor Logs reference - AADNonInteractiveUserSignInLogs. Retrieved 2026-11-25.
Contains the error code, if any, for the sign-in operation.
S42. Microsoft (Microsoft Learn, Microsoft Graph), List signIns. Retrieved 2026-11-25.
To avoid having the request time out, apply the $filter parameter with a time range for which to get all sign-ins
Sign-ins that are interactive in nature
S69. Microsoft (Microsoft Learn, Microsoft Graph PowerShell), Get-MgAuditLogSignIn (Microsoft.Graph.Reports). Retrieved 2026-11-25.
-All List all pages.
