How to Clear the cache token in MSAL SPA?
Asked Answered
A

1

5

I have the functionality when the user doesn't accept the Permission ( At the first time login) I am redirecting it to Signin page. Since the token is cached it is constantly showing the Permission page.

Is there a way to clear the token which is cached ?

Acord answered 24/8, 2021 at 13:2 Comment(2)
I don't think that's MSAL that is caching there, it's Azure AD. You can specify a prompt query parameter to the request to change what Azure AD does: learn.microsoft.com/en-us/azure/active-directory/develop/… (scroll down to the table and find the prompt parameter for the options)Lenette
Cool. It worked. ThanksAcord
L
6

I don't think that's MSAL that is caching there, it's Azure AD. You can specify a prompt query parameter to the request to change what Azure AD does: https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-implicit-grant-flow#send-the-sign-in-request (scroll down to the table and find the prompt parameter for the options).

For example prompt=select_account will force an account chooser.

Lenette answered 24/8, 2021 at 13:37 Comment(1)
Hello juunas, will the select prompt work on mobile?Butternut

© 2022 - 2024 — McMap. All rights reserved.