Entra ID sign-in error
AADSTS50173: Refresh token revoked or expired
AADSTS50173 means the app's refresh token was revoked, usually after a password change or an admin revoking sessions. How users and apps recover.
AADSTS50173
The provided grant has expired due to it being revoked, a fresh auth token is needed.
What it means
The refresh token the app used was revoked or has expired. Common triggers are the user changing or resetting their password, or an admin revoking the user's sessions.
Fix it: tenant admins
Revoke sessionson the user's Overview page causes this on purpose. After a password change it is expected.
Fix it: app developers
- Handle the error by sending the user through an interactive sign-in to get a fresh token. With MSAL, follow its error and exception handling guidance.
Fix it: the person signing in
- Sign out of the app and sign in again, or use its option to re-authenticate or clear cached sign-in data.
Related codes
Microsoft sources
- Error AADSTS50173: the provided grant has expired due to it being revoked
- Microsoft Entra authentication and authorization error codes (the full list)
- Microsoft's live lookup for 50173 (login.microsoftonline.com)
Find who is hitting AADSTS50173
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 == "50173"
| 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 50173 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.
S63. Microsoft (Microsoft Learn), Error code AADSTS50173 - The Provided Grant Has Expired Due to it Being Revoked. Retrieved 2026-11-25.
This error occurs if the refresh token that's used for authentication is revoked.
The user changes or resets their password.
An administrator revokes the refresh token.
On the application that experiences the issues, try to locate an option to reauthenticate or clear any cached token information.
The goal is to request that the user reauthenticate and obtain a fresh token.
S47. Microsoft (Microsoft Learn), Revoke user access in an emergency in Microsoft Entra ID. Retrieved 2026-11-25.
On the user Overview page, select Revoke sessions.
S62. Microsoft (Microsoft Learn, Power Automate), Resolve Power Automate Broken Connections. Retrieved 2026-11-25.
Every time that you update your password, you invalidate the existing connection that uses the old password.
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.
