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

Fix MSAL cache cleaning method #675

Merged
merged 5 commits into from May 3, 2019
Merged

Conversation

pkanher617
Copy link
Contributor

This PR is a fix for issue #527 where cache keys are not being cleared out.

A previous PR (#544) was submitted for this, but was failing some use cases. This fix works for manually tested use cases and passes all unit tests.

@DarylThayil
Copy link
Contributor

few questions / comments but looks good to me

// Cache account and authority
this.setAccountCache(account, serverAuthenticationRequest.state);
this.setAuthorityCache(serverAuthenticationRequest.state, acquireTokenAuthority.CanonicalAuthority);
this.updateAcquireTokenCacheEntries(serverAuthenticationRequest, account);
Copy link
Member

Choose a reason for hiding this comment

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

@pkanher617 As discussed you may want to combine the login calls caching code for "authority" and "nonce" also into this API. Please factor that login calls do not have "acquireTokenAccountKey".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added to updateCacheEntries. Please check new code.

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.

Looks good except the one comment.


// Cache account and authority
this.setAccountCache(account, serverAuthenticationRequest.state);
this.setAuthorityCache(serverAuthenticationRequest.state, acquireTokenAuthority.CanonicalAuthority);

Choose a reason for hiding this comment

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

it's canonicalAuthority here, however in the updateCacheEntries is using authority


// Cache account and authority
this.setAccountCache(account, serverAuthenticationRequest.state);
this.setAuthorityCache(serverAuthenticationRequest.state, acquireTokenAuthority.CanonicalAuthority);

Choose a reason for hiding this comment

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

CanonicalAuthority - same as the other comment

@DarylThayil
Copy link
Contributor

lgtm approved

@sameerag sameerag merged commit 77f0470 into state_config_to_req May 3, 2019
@pkanher617 pkanher617 deleted the cache_cleanup branch May 3, 2019 18:32
@pkanher617 pkanher617 restored the cache_cleanup branch May 3, 2019 22:35
@pkanher617 pkanher617 deleted the cache_cleanup branch May 3, 2019 22:35
@pkanher617 pkanher617 mentioned this pull request May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants