Home

Azure AD OAuth 2.0 Access Token has expired

Han Valk
Occasional Contributor

For testing purposes it is sometimes usefull to revoke a STS token. On AD FS there are ways to do this e.g. Revoke-AzureADSignedInUserAllRefreshToken.

Is there a way to revoke an Azure AD sts token either on the Azure AD side or the client side e.g. by removing/deleting it from the client. Deleting cookies unfortunately doesn't work.

1 Reply

Hi Han,

 

Revoking a user’s active refresh tokens is simple and can be done on an ad-hoc basis. You do this by setting the StsRefreshTokensValidFrom on the user object, so any refresh tokens tied to a credential provided before the time this attribute was set will no longer be honored by Azure AD. The user will be forced to re-authenticate to receive a new refresh token.

Follow these steps to revoke a user’s refresh tokens:

  1. Download the latest Azure AD PowerShell V1 release.
  2. Run the Connect command to sign in to your Azure AD admin account. Run this command each time you start a new session:

    Connect-msolservice

  3. Set the StsRefreshTokensValidFrom parameter using the following command:

    Set-MsolUser -UserPrincipalName <UPN of the User> -StsRefreshTokensValidFrom (“<current date>”)

I hope this helps.

 

Best regards,

Ruud Gijsbers

Related Conversations
Extentions Synchronization
Deleted in Discussions on
3 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
36 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
9 Replies