Skip to content
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

Add storeInCache request parameter to control which tokens are persisted to the cache #6248

Merged
merged 19 commits into from
Jul 31, 2023

Conversation

tnorling
Copy link
Collaborator

Adds new request parameter to control which tokens should be stored in the cache. This will give us more flexibility and enable our 1P library to use our public APIs rather than depend on and/or re-implement internal implementation details.

Note: msal-node is out of scope for this change for now. If there's a need to extend this feature to node in the future the param can be removed from the "Omit" list of the request types and tests added.

@github-actions github-actions bot added msal-node Related to msal-node package msal-browser Related to msal-browser package msal-common Related to msal-common package labels Jul 18, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jul 18, 2023

Codecov Report

Merging #6248 (f53ef12) into dev (81d34b4) will decrease coverage by 1.07%.
Report is 222 commits behind head on dev.
The diff coverage is 67.42%.

Flag Coverage Δ
msal-angular 96.73% <92.78%> (+0.22%) ⬆️
msal-browser 85.69% <ø> (-0.78%) ⬇️
msal-common ?
msal-core ?
msal-node ?
msal-node-extensions 68.51% <60.77%> (-7.13%) ⬇️
msal-react ?
node-token-validation ?
Files Changed Coverage Δ
...ions/msal-node-extensions/src/utils/Environment.ts 20.51% <0.00%> (-22.08%) ⬇️
lib/msal-angular/src/msal.interceptor.ts 100.00% <ø> (ø)
lib/msal-angular/src/msal.module.ts 100.00% <ø> (ø)
lib/msal-angular/src/msal.navigation.client.ts 93.33% <ø> (+0.47%) ⬆️
lib/msal-angular/src/msal.redirect.component.ts 100.00% <ø> (ø)
lib/msal-angular/src/msal.service.ts 100.00% <ø> (ø)
lib/msal-angular/src/packageMetadata.ts 100.00% <ø> (ø)
...b/msal-browser/src/app/IPublicClientApplication.ts 43.75% <ø> (ø)
...ib/msal-browser/src/app/PublicClientApplication.ts 66.66% <ø> (-28.67%) ⬇️
...er/src/broker/nativeBroker/NativeMessageHandler.ts 86.29% <ø> (+0.33%) ⬆️
... and 67 more

... and 165 files with indirect coverage changes

Copy link
Member

@hectormmg hectormmg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@lalimasharda lalimasharda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@peterzenz
Copy link
Contributor

How does this work with WAM/Native Brokers? If the app experience is going to be very different between a pure browser flow and a JS/Native flow because of this, then I'd suggest we back this change out.

@tnorling
Copy link
Collaborator Author

How does this work with WAM/Native Brokers? If the app experience is going to be very different between a pure browser flow and a JS/Native flow because of this, then I'd suggest we back this change out.

This is referring to the local MSAL cache (browser storage) and applies regardless of where the token came from. I'm not the biggest fan of the parameter name myself but if you have suggestions for making this clearer or an alternative solution let me know.

@github-actions github-actions bot added the documentation Related to documentation. label Jul 28, 2023
@tnorling tnorling merged commit d8b4b70 into dev Jul 31, 2023
40 of 42 checks passed
@tnorling tnorling deleted the storeInCache-config branch July 31, 2023 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to documentation. msal-browser Related to msal-browser package msal-common Related to msal-common package msal-node Related to msal-node package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants