{
  "schemaVersion": "1.0",
  "code": "50133",
  "name": "SsoArtifactRevoked",
  "title": "AADSTS50133: Session invalid after password change or expiry",
  "url": "https://brambrinkmeier.com/entra/aadsts/50133/",
  "alternates": {
    "markdown": "https://brambrinkmeier.com/entra/aadsts/50133.md",
    "json": "https://brambrinkmeier.com/api/aadsts/50133.json",
    "html": "https://brambrinkmeier.com/entra/aadsts/50133/"
  },
  "description": "AADSTS50133: a session became invalid after a password change or expiry. After a compromise it shows where old sessions ran. KQL hunt included.",
  "summary": "AADSTS50133 means Microsoft Entra ID rejected an existing sign-in session because the user's password expired or was recently changed. It is normally a one-off after a password change. After a compromise, rows from IPs or devices the user doesn't own show where an old session was still in use. Hunt it in SigninLogs and AADNonInteractiveUserSignInLogs.",
  "inMicrosoftReference": true,
  "unlistedChecked": null,
  "meaningText": "Microsoft's description:\n\n> **SsoArtifactRevoked**: The session isn't valid due to password expiration or recent password change.\n\nA client presented a session that existed before the password changed or expired. Microsoft no longer accepts it. The user has to sign in again.\n\nTwo close relatives in the reference table:\n\n- **50132 SsoArtifactInvalidOrExpired** carries the same description text: *\"The session isn't valid due to password expiration or recent password change.\"*\n- **50089**: *\"Authentication failed due to flow token expired. Expected - auth codes, refresh tokens, and sessions expire over time or are revoked by the user or an admin.\"*",
  "sections": [
    {
      "heading": "What does AADSTS50133 mean?",
      "text": "Microsoft's description:\n\n> **SsoArtifactRevoked**: The session isn't valid due to password expiration or recent password change.\n\nA client presented a session that existed before the password changed or expired. Microsoft no longer accepts it. The user has to sign in again.\n\nTwo close relatives in the reference table:\n\n- **50132 SsoArtifactInvalidOrExpired** carries the same description text: *\"The session isn't valid due to password expiration or recent password change.\"*\n- **50089**: *\"Authentication failed due to flow token expired. Expected - auth codes, refresh tokens, and sessions expire over time or are revoked by the user or an admin.\"*"
    },
    {
      "heading": "Is it an attack?",
      "text": "See the [comparison of the codes behind \"asked to sign in again\"](https://brambrinkmeier.com/guides/why-user-asked-to-sign-in-again-entra-id/) (70043, 700082, 50173, 50133, 50076).\n\nAlmost never on its own. 50133 is the normal consequence of a password change or expiry. It is the session counterpart of [50173](https://brambrinkmeier.com/entra/aadsts/50173/), which is the same idea for refresh tokens. The [session revocation guide](https://brambrinkmeier.com/guides/revoke-sessions-and-verify-entra-id/) shows how both codes prove a response worked.\n\n| Pattern | Likely meaning |\n|---|---|\n| A few 50133 rows for one user right after their password change, from their usual IPs and devices, then a success | The user's own sessions being reset. Benign. |\n| 50133 after you reset a **compromised** user's password, from an IP or device you can't tie to the user | A session you didn't know about was still being used. Treat it as an attacker indicator and pivot on the IP. |\n| 50133 for many users at once | A batch of password expiries or a bulk reset. Check your password policy and change history before investigating further. |\n\nThis is reasoning from Microsoft's description, not a documented detection: the code tells you a pre-change session was presented, and the row tells you from where. Whether that location is suspicious is your call."
    },
    {
      "heading": "How do I find it in my logs (KQL)?",
      "text": "After a password reset on a user you suspect was compromised, list every place an old session was presented. `DeviceDetail` and `LocationDetails` are dynamic in `SigninLogs` and **strings** in `AADNonInteractiveUserSignInLogs`, so each side is normalised before the union.\n\n```kusto\nlet targetUser = \"{user-principal-name}\";\nlet resetAt = datetime(2026-10-11T09:00:00Z);\nunion\n    (SigninLogs\n     | extend Device = DeviceDetail, Location = LocationDetails, Table = \"Interactive\"),\n    (AADNonInteractiveUserSignInLogs\n     | extend Device = parse_json(DeviceDetail), Location = parse_json(LocationDetails), Table = \"NonInteractive\")\n| where TimeGenerated > resetAt\n| where UserPrincipalName =~ targetUser\n| where ResultType in (\"50133\", \"50132\")\n| summarize FirstSeen = min(TimeGenerated),\n            LastSeen = max(TimeGenerated),\n            Apps = make_set(AppDisplayName, 10)\n          by Table, ResultType, IPAddress,\n             Country = tostring(Location.countryOrRegion),\n             OS = tostring(Device.operatingSystem),\n             Browser = tostring(Device.browser),\n             DeviceId = tostring(Device.deviceId),\n             UserAgent\n| sort by FirstSeen asc\n```\n\nTenant-wide baseline, so you know what normal looks like before an incident:\n\n```kusto\nSigninLogs\n| where TimeGenerated > ago(7d)\n| where ResultType == \"50133\"\n| summarize Rows = count(), Users = dcount(UserPrincipalName) by bin(TimeGenerated, 1d)\n| sort by TimeGenerated asc\n```\n\n`ResultType` is a **string** column, so compare it with `\"50133\"`, not `50133`. The JSON field names inside `Device` and `Location` follow the Microsoft Graph `signIn` resource; check them against a row in your own workspace."
    },
    {
      "heading": "How do Conditional Access and MFA affect it?",
      "text": "- No Conditional Access policy causes 50133. The password change does.\n- The fresh sign-in that follows goes through the password check, MFA and Conditional Access again. An old session no longer skips those checks.\n- If the attacker may have registered their own MFA method on the account, a password reset alone is not the whole response. Review the user's registered methods as part of the same incident."
    },
    {
      "heading": "How do I fix AADSTS50133?",
      "text": "**For the user:** sign in again with the new password.\n\n**For admins:**\n1. If this follows a suspected compromise, also revoke sessions explicitly (`Revoke-MgUserSignInSession -UserId $User.Id` or **Revoke sessions**). That is Microsoft's documented response step. Refresh tokens that fail after a revocation or password change show up as [50173](https://brambrinkmeier.com/entra/aadsts/50173/).\n2. Run the first query for the time after the reset and block any IP that isn't the user's.\n3. If you see 50133 for many users unexpectedly, check for a password expiry wave before treating it as an incident."
    }
  ],
  "microsoftWording": {
    "text": "**SsoArtifactRevoked**: The session isn't valid due to password expiration or recent password change.",
    "source": "Microsoft's error code reference, as quoted on the page",
    "sourceUrl": "https://learn.microsoft.com/en-us/entra/identity-platform/reference-error-codes"
  },
  "securityReading": {
    "category": {
      "id": "token",
      "label": "Tokens and sessions"
    },
    "kind": {
      "id": "failure",
      "label": "Failure"
    },
    "attackSignal": {
      "level": "low",
      "label": "Low: usually configuration or user error"
    },
    "mitre": [],
    "tables": [
      "SigninLogs",
      "AADNonInteractiveUserSignInLogs"
    ],
    "isItAnAttack": "See the [comparison of the codes behind \"asked to sign in again\"](https://brambrinkmeier.com/guides/why-user-asked-to-sign-in-again-entra-id/) (70043, 700082, 50173, 50133, 50076).\n\nAlmost never on its own. 50133 is the normal consequence of a password change or expiry. It is the session counterpart of [50173](https://brambrinkmeier.com/entra/aadsts/50173/), which is the same idea for refresh tokens. The [session revocation guide](https://brambrinkmeier.com/guides/revoke-sessions-and-verify-entra-id/) shows how both codes prove a response worked.\n\n| Pattern | Likely meaning |\n|---|---|\n| A few 50133 rows for one user right after their password change, from their usual IPs and devices, then a success | The user's own sessions being reset. Benign. |\n| 50133 after you reset a **compromised** user's password, from an IP or device you can't tie to the user | A session you didn't know about was still being used. Treat it as an attacker indicator and pivot on the IP. |\n| 50133 for many users at once | A batch of password expiries or a bulk reset. Check your password policy and change history before investigating further. |\n\nThis is reasoning from Microsoft's description, not a documented detection: the code tells you a pre-change session was presented, and the row tells you from where. Whether that location is suspicious is your call.",
    "conditionalAccess": {
      "heading": "How do Conditional Access and MFA affect it?",
      "text": "- No Conditional Access policy causes 50133. The password change does.\n- The fresh sign-in that follows goes through the password check, MFA and Conditional Access again. An old session no longer skips those checks.\n- If the attacker may have registered their own MFA method on the account, a password reset alone is not the whole response. Review the user's registered methods as part of the same incident."
    }
  },
  "kql": [
    {
      "title": null,
      "leadIn": "After a password reset on a user you suspect was compromised, list every place an old session was presented. `DeviceDetail` and `LocationDetails` are dynamic in `SigninLogs` and **strings** in `AADNonInteractiveUserSignInLogs`, so each side is normalised before the union.",
      "query": "let targetUser = \"{user-principal-name}\";\nlet resetAt = datetime(2026-10-11T09:00:00Z);\nunion\n    (SigninLogs\n     | extend Device = DeviceDetail, Location = LocationDetails, Table = \"Interactive\"),\n    (AADNonInteractiveUserSignInLogs\n     | extend Device = parse_json(DeviceDetail), Location = parse_json(LocationDetails), Table = \"NonInteractive\")\n| where TimeGenerated > resetAt\n| where UserPrincipalName =~ targetUser\n| where ResultType in (\"50133\", \"50132\")\n| summarize FirstSeen = min(TimeGenerated),\n            LastSeen = max(TimeGenerated),\n            Apps = make_set(AppDisplayName, 10)\n          by Table, ResultType, IPAddress,\n             Country = tostring(Location.countryOrRegion),\n             OS = tostring(Device.operatingSystem),\n             Browser = tostring(Device.browser),\n             DeviceId = tostring(Device.deviceId),\n             UserAgent\n| sort by FirstSeen asc"
    },
    {
      "title": null,
      "leadIn": "Tenant-wide baseline, so you know what normal looks like before an incident:",
      "query": "SigninLogs\n| where TimeGenerated > ago(7d)\n| where ResultType == \"50133\"\n| summarize Rows = count(), Users = dcount(UserPrincipalName) by bin(TimeGenerated, 1d)\n| sort by TimeGenerated asc"
    }
  ],
  "kqlSectionText": "After a password reset on a user you suspect was compromised, list every place an old session was presented. `DeviceDetail` and `LocationDetails` are dynamic in `SigninLogs` and **strings** in `AADNonInteractiveUserSignInLogs`, so each side is normalised before the union.\n\n```kusto\nlet targetUser = \"{user-principal-name}\";\nlet resetAt = datetime(2026-10-11T09:00:00Z);\nunion\n    (SigninLogs\n     | extend Device = DeviceDetail, Location = LocationDetails, Table = \"Interactive\"),\n    (AADNonInteractiveUserSignInLogs\n     | extend Device = parse_json(DeviceDetail), Location = parse_json(LocationDetails), Table = \"NonInteractive\")\n| where TimeGenerated > resetAt\n| where UserPrincipalName =~ targetUser\n| where ResultType in (\"50133\", \"50132\")\n| summarize FirstSeen = min(TimeGenerated),\n            LastSeen = max(TimeGenerated),\n            Apps = make_set(AppDisplayName, 10)\n          by Table, ResultType, IPAddress,\n             Country = tostring(Location.countryOrRegion),\n             OS = tostring(Device.operatingSystem),\n             Browser = tostring(Device.browser),\n             DeviceId = tostring(Device.deviceId),\n             UserAgent\n| sort by FirstSeen asc\n```\n\nTenant-wide baseline, so you know what normal looks like before an incident:\n\n```kusto\nSigninLogs\n| where TimeGenerated > ago(7d)\n| where ResultType == \"50133\"\n| summarize Rows = count(), Users = dcount(UserPrincipalName) by bin(TimeGenerated, 1d)\n| sort by TimeGenerated asc\n```\n\n`ResultType` is a **string** column, so compare it with `\"50133\"`, not `50133`. The JSON field names inside `Device` and `Location` follow the Microsoft Graph `signIn` resource; check them against a row in your own workspace.",
  "fix": {
    "short": "User: sign in again with your new password. Admin: if this follows a suspected compromise, also revoke sessions (`Revoke-MgUserSignInSession`), then list where old sessions were presented after the reset and block any IP that isn't the user's.",
    "steps": "**For the user:** sign in again with the new password.\n\n**For admins:**\n1. If this follows a suspected compromise, also revoke sessions explicitly (`Revoke-MgUserSignInSession -UserId $User.Id` or **Revoke sessions**). That is Microsoft's documented response step. Refresh tokens that fail after a revocation or password change show up as [50173](https://brambrinkmeier.com/entra/aadsts/50173/).\n2. Run the first query for the time after the reset and block any IP that isn't the user's.\n3. If you see 50133 for many users unexpectedly, check for a password expiry wave before treating it as an incident."
  },
  "labReproduced": null,
  "labSectionText": null,
  "labRuns": [],
  "verification": "documentation",
  "related": [
    "50173",
    "50055",
    "70043",
    "700082",
    "50126",
    "50054",
    "50089",
    "50140",
    "70008",
    "70044"
  ],
  "coveredBy": [
    {
      "title": "After a compromise: revoke Entra ID sessions and prove it worked",
      "url": "https://brambrinkmeier.com/guides/revoke-sessions-and-verify-entra-id/"
    },
    {
      "title": "Why is the user asked to sign in again? AADSTS70043, 700082, 50173, 50133, 50076",
      "url": "https://brambrinkmeier.com/guides/why-user-asked-to-sign-in-again-entra-id/"
    }
  ],
  "sources": [
    {
      "title": "Microsoft Entra authentication and authorization error codes",
      "url": "https://learn.microsoft.com/en-us/entra/identity-platform/reference-error-codes"
    },
    {
      "title": "Revoke user access in Microsoft Entra ID",
      "url": "https://learn.microsoft.com/en-us/entra/identity/users/users-revoke-access"
    },
    {
      "title": "Sign-in log activity details",
      "url": "https://learn.microsoft.com/en-us/entra/identity/monitoring-health/concept-sign-in-log-activity-details"
    },
    {
      "title": "AADNonInteractiveUserSignInLogs table reference (Azure Monitor)",
      "url": "https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/aadnoninteractiveusersigninlogs"
    }
  ],
  "published": null,
  "lastUpdated": "2026-10-11",
  "lastVerified": null,
  "license": "CC BY 4.0",
  "licenseUrl": "https://creativecommons.org/licenses/by/4.0/",
  "licenseNote": "CC BY 4.0 covers the author's own text and classification fields. Quoted Microsoft error wording belongs to Microsoft, is quoted with its source and can change.",
  "attribution": "Bram Brinkmeier, \"AADSTS50133: Session invalid after password change or expiry\", https://brambrinkmeier.com/entra/aadsts/50133/ (CC BY 4.0)",
  "microsoftErrorLookup": "https://login.microsoftonline.com/error?code=50133"
}
