Azure B2C implicit flow: acquire new access token witout the use of an iFrame

231 Views Asked by At

In the Azure B2C documentation you have this information about silently acquiring new access tokens when the previous one expired.

ID tokens and access tokens both expire after a short period of time. Your app must be prepared to refresh these tokens periodically. To refresh either type of token, perform the same hidden iframe request we used in an earlier example, by using the prompt=none parameter to control Azure AD steps. To receive a new id_token value, be sure to use response_type=id_token and scope=openid, and a nonce parameter.

Is there a way to do this without an iFrame?

1

There are 1 best solutions below

0
Jas Suri - MSFT On

You can do it with a full redirect by calling acquireTokenReditect() with MSAL. There is no other option in a javascript app. This of course is not going to be a good UX as you’d need to do it every time the api resource changes or scope changes.