Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure ADB2C logout doesn't invalidates access token #35370

Closed
Statowfiq opened this issue Jul 18, 2019 · 7 comments
Closed

Azure ADB2C logout doesn't invalidates access token #35370

Statowfiq opened this issue Jul 18, 2019 · 7 comments

Comments

@Statowfiq
Copy link

Statowfiq commented Jul 18, 2019

Azure ADB2C logout doesn't invalidates access token.

I am using MSAL 0.2.4 library. The logout function logs out me from my application and redirects me back to login. But the access token is still alive. I am able to use the old access token to access my webAPI.

The access token is not getting invalidated post logout.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@shashishailaj
Copy link
Member

@Statowfiq Thank you for your query. We will investigate and update this thread further.

@yoelhor
Copy link
Contributor

yoelhor commented Jul 30, 2019

The access and ID tokens issue by Azure AD B2C are self-contained. So that an application needs no further interaction with Azure AD B2C to perform an authorization decision of the client requesting access to a protected resource. After an access token is issued, there is no way to invalidate it (since there shouldn’t be any further interaction with Azure AD B2C).

Azure AD B2C support the revocation of refresh tokens, by calling Azure AD Graph invalidateAllRefreshTokens

You can configure Azure AD B2C to issue short-lived access tokens, for example 60 minutes or so, which can be refreshed at any time using the corresponding refresh tokens. This allows Azure AD B2C to impose a limit on the time revoked when access tokens need to refresh.

@ManojReddy-MSFT
Copy link
Member

@Statowfiq We will now proceed to close this thread. If you have further questions, please tag me in the comments and I will gladly continue the conversation.

@iliassk
Copy link

iliassk commented Jul 1, 2020

About revoking refresh tokens:

@yoelhor @ManojReddy-MSFT , I couldn't find any docs describing how we can call Microsoft Graph's invalidateAllRefreshTokens or revokeSignInSessions when a user authenticates on an Azure AD B2C via the b2clogin.com V2 endpoints.

I have no idea how I can revoke the refresh token once I initiate the logout from my app. Most docs seem to focus on AAD or (soon-to-be) deprecated V1 or Graph API endpoints. How can we achieve this on Azure AD B2C with the b2clogin.com V2 endpoints? Knowing that we cannot use the Azure AD B2C issued access tokens to call Azure AD or Microsoft Graph API.

Should we use built-in or custom policies? Is it even possible?

Thank you !

@droidamar007
Copy link

@iliassk Did you find any way to invalidate refreshToken? I'm also facing the same issue and stuck for several weeks.

If you find any way please help me out.

Thanks!

@iliassk
Copy link

iliassk commented Apr 4, 2021

@droidamar007 I haven't tried but you should check out https://docs.microsoft.com/en-us/graph/api/user-revokesigninsessions?view=graph-rest-1.0&tabs=http to invalidate the refresh tokens through the Microsoft Graph API.

@droidamar007
Copy link

Thanks, @iliassk

I've already tried this. When I'm calling this API call using MS graph API, I'm not getting any error and it working fine now but the problem is, even after revoking singin session I'm able to get a new access token using the refresh token.

That's is bit strange and not able to find any blog or post on this.

Thanks for your quick reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment