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

Separate Cache Lookup and Token Refresh in SilentFlowClient #2189

Merged
merged 17 commits into from Aug 27, 2020

Conversation

tnorling
Copy link
Collaborator

@tnorling tnorling commented Aug 25, 2020

This PR mainly refactors the SilentFlowClient and provides 2 additional APIs

Changes include:

  • Addition of acquireCachedToken and refreshToken function in SilentFlowClient
  • Original acquireToken function refactored to call the 2 new APIs
  • Move the token cache lookups to CacheManager
  • Add getCacheRecord function to CacheManager to do all the token cache lookups in one place

@github-actions github-actions bot added the msal-common Related to msal-common package label Aug 25, 2020
@coveralls
Copy link

coveralls commented Aug 26, 2020

Coverage Status

Coverage increased (+0.2%) to 83.23% when pulling f7a7492 on separate-acquireCachedToken-refreshToken into 64835e2 on dev.

@tnorling tnorling marked this pull request as ready for review August 26, 2020 23:54
credentialType: CredentialType.ACCESS_TOKEN,
clientId,
realm: account.tenantId,
target: scopes.printScopesLowerCase()
Copy link
Member

Choose a reason for hiding this comment

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

We are storing scopes in lower case and look-up in lower case. We need to address this, as I observed in cache-compat test cases, other libraries store the case as is. We may need to talk about this.

My take: Look up should be case insensitive but storing should be as is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

100% agree. As this PR is scoped to a refactor, let's take functional changes in a follow up PR

Copy link
Member

@sameerag sameerag left a comment

Choose a reason for hiding this comment

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

Please test silent use case for node before merging this!

@tnorling tnorling merged commit db612e3 into dev Aug 27, 2020
@tnorling tnorling deleted the separate-acquireCachedToken-refreshToken branch September 29, 2020 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
msal-common Related to msal-common package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants