Please follow the issue template below. Failure to do so will result in a delay in answering your question.
[email protected] or @azure/[email protected]@azure/[email protected]@azure/[email protected]@azure/[email protected]@azure/[email protected]I'm using msal-browser 2.0 together with B2C. I'm successfully authenticating a user and retrieves an idToken (together with idTokenClaims) in handleRedirectPromise(). The data received in the idTokenClaims.groups defines what groups the logged in user is associated with. This data is needed client side to customise the user experience (e.g. to give access only to the user authorised pages).
However, I can't find a way to programatically ask msal-browser 2.0 for e.g. the idTokenClaims. This becomes a problem on a full page reload where the handleRedirectPromise() will be called with a null response (as per the docs).
My questions:
msal-browser 2.x doesn't expose an api to get the id token data for the already logged in accounts (as in getAccounts())? This seem to have been changed from comparing with msal-browser 1.0 where id token data can be obtained by calling getAccount(). Can't seem to find any docs about best practise for this use case. Or am I missing something?idTokenClaims for logged in accounts using msal-browser 2.x? One idea I have is to save the token response from handleRedirectPromise() in e.g. local storage and then read it from there when needed, but I can't understand why the library don't just expose this data to the consumer via an api (since the lib have stored it in session/local storage).@dangrahn Thanks for bringing this to our attention. This can be possible and I am marking this as an enhancement to our library. Please watch out this space for a PR.
@jasonnutter Any update on this?
Thanks for doing the work @jasonnutter - any idea when that will be released?
When will this feature be released? We request this feature ugently. Thanks!
Any indicative timeline on when this will be released?
@azure/[email protected] is now available on npm.
Most helpful comment
@dangrahn Thanks for bringing this to our attention. This can be possible and I am marking this as an
enhancementto our library. Please watch out this space for a PR.