Node: AccountUserInfo.idTokenClaims is undefined when deserializing from cache
See original GitHub issueLibrary
-
@azure/msal-node@1.0.1
Framework
- Electron
Description
I’m following the Msal Electron Node sample (link) and I would like to read the user roles (authProvider.currentAccount.idTokenClaims.roles
) but idTokenClaims
is always undefined, even if I do have the object properly populated with the roles array after doing the login and before serializing it and saving it into the cache file. It seems like the Serializer (link) does not include information about idTokenClaims.roles
, or I might be missing something regarding how (if possible) to get this information based on what is serialized inside the IdToken
object.
Error Message
MSAL Configuration
Reproduction steps
Try to obtain information about the user roles authProvider.currentAccount.idTokenClaims.roles
.
Expected behavior
User roles information should be exposed via idTokenClaims.roles
Identity Provider
- Azure AD
- Azure B2C Basic Policy
- Azure B2C Custom Policy
- ADFS
- Other
Browsers/Environment
- Chrome
- Firefox
- Edge
- Safari
- IE
- Other (Electron)
Regression
- Did this behavior work before? Version:
Security
- Is this issue security related?
Source
- Customer request
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:18 (13 by maintainers)
Top Results From Across the Web
Learn about Microsoft Authentication Extensions for Node
The Microsoft Authentication Extensions for Node enables application developers to perform cross-platform token cache serialization and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is it foreseeable when this bug will be fixed? Currently the ID token claims are completely empty when deserializing from the cache. This requires a messy workaround and you have to persist the claims yourself elsewhere.
Thank you so much!
#4081 is merged now. Closing this issue. Please test and raise another issue if you are still seeing this problem.