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
Extend msal-browser TokenCache loadExternalTokens to load refresh tokens #5233
Extend msal-browser TokenCache loadExternalTokens to load refresh tokens #5233
Conversation
…en and return account id
06e27c7
to
879f28f
Compare
@lvalentine Please run |
change/@azure-msal-browser-321fc9fc-e44c-4168-8b90-7b77291857d1.json
Outdated
Show resolved
Hide resolved
change/@azure-msal-common-4922da53-5379-4871-ab08-329b7ada9d93.json
Outdated
Show resolved
Hide resolved
Codecov Report
*This pull request uses carry forward flags. Click here to find out more.
|
…1.json Co-authored-by: Jason Nutter <jasonnutter@outlook.com>
….json Co-authored-by: Jason Nutter <jasonnutter@outlook.com>
One more comment on style, otherwise looks great, thanks for addressing feedback! |
…thub.com/lvalentine/microsoft-authentication-library-for-js into user/louisv/external_load_refresh_tokens
…to build cache record
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just a final optional nit. Thanks for the contribution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing feedback!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving
🎉 We recommend upgrading to the latest version of Handy links: |
🎉 Handy links: |
This change extends the
TokenCache.loadExternalTokens
method to support loading refresh tokens. It also makes a few small changes inTokenCache
to make it easier to use this functionality from an application:TokenCache.loadExternalTokens
now returns aAuthenticationResult
for the response that was loaded. This allows the calling code to easily get access to the newly loaded account without having to know anything about how msal creates the account id from the Request/Response that was loaded (ie. fromIPublicClientApplication.getAccountByHomeId
).TokenCache.loadIdToken
generates thehomeAccountId
from the request to match the same method used inNativeInteractionClient
, usingAccountEntity.generateHomeAccountId
. This change was made so that the tokens that are initially side loaded via theTokenCache.loadExternalTokens
method can be found in the cache and refreshed when acquiring access tokens via a supported path likeIPublicClientApplication.acquireTokenSilent
.