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

Modified refreshOn in MSAL Common Silent Flow to return cached token before refreshing in the background #6397

Merged
merged 28 commits into from
Sep 14, 2023

Conversation

Robbie-Microsoft
Copy link
Collaborator

refreshOn functionality already exists in Silent Flow. That is, if a token needs to be refreshed but is not expired, an error was thrown and the token was refreshed. This PR contains changes that will now return the cached token if it needs to be refreshed and is not expired, while also refreshing the token in the background.

@github-actions github-actions bot added msal-node Related to msal-node package msal-common Related to msal-common package labels Aug 25, 2023
@Robbie-Microsoft Robbie-Microsoft changed the title Modified refreshOn in MSAL Common Silent Flow to also return cached token Modified refreshOn in MSAL Common Silent Flow to return cached token before refreshing in the background Aug 25, 2023
@codecov-commenter
Copy link

codecov-commenter commented Aug 25, 2023

Codecov Report

Merging #6397 (5e38ebe) into dev (81d34b4) will decrease coverage by 1.78%.
Report is 312 commits behind head on dev.
The diff coverage is 61.03%.

Flag Coverage Δ
msal-angular 96.73% <ø> (+0.22%) ⬆️
msal-browser 85.32% <ø> (-1.15%) ⬇️
msal-common 83.50% <ø> (-1.05%) ⬇️
msal-core ?
msal-node 80.16% <ø> (-3.23%) ⬇️
msal-node-extensions 68.51% <60.77%> (-7.13%) ⬇️
msal-react 94.24% <ø> (-0.45%) ⬇️
node-token-validation ?
Files Changed Coverage Δ
...ions/msal-node-extensions/src/utils/Environment.ts 20.51% <0.00%> (-22.08%) ⬇️
lib/msal-angular/src/constants.ts 100.00% <ø> (ø)
lib/msal-angular/src/msal.broadcast.service.ts 100.00% <ø> (ø)
lib/msal-angular/src/msal.guard.ts 90.78% <ø> (+0.64%) ⬆️
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% <ø> (ø)
... and 69 more

... and 164 files with indirect coverage changes

Copy link
Member

@bgavrilMS bgavrilMS left a comment

Choose a reason for hiding this comment

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

No sleep in tests; Errors must be actionable.

lib/msal-common/src/client/SilentFlowClient.ts Outdated Show resolved Hide resolved
lib/msal-common/src/client/SilentFlowClient.ts Outdated Show resolved Hide resolved
lib/msal-common/src/client/RefreshTokenClient.ts Outdated Show resolved Hide resolved
@github-actions github-actions bot added the msal-browser Related to msal-browser package label Sep 14, 2023
@Robbie-Microsoft Robbie-Microsoft merged commit 3f74c72 into dev Sep 14, 2023
43 of 44 checks passed
@Robbie-Microsoft Robbie-Microsoft deleted the proactive_refresh_silent_flow branch September 14, 2023 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

None yet

6 participants