[Proof of Concept] Call remove_account when new account is created#1
Open
[Proof of Concept] Call remove_account when new account is created#1
remove_account when new account is created#1Conversation
remove_account when new account is createdremove_account when new account is created
|
One concern I have with this approach is that it may unintentionally invalidate the cache in normal usage. Removing an account from the cache entails removing all its associated tokens. It appears MSAL caches an account whenever it receives client_info and an ID token, and that it always requests these. I worry this might then be possible:
|
Owner
Author
|
My change will not evict all the user's cached tokens when doing cross-scope refreshing, because |
jiasli
commented
Apr 8, 2021
Comment on lines
153
to
154
| if client_info and not event.get("skip_account_creation"): | ||
| account = { |
Owner
Author
There was a problem hiding this comment.
The order of adding tokens to the cache matters. Always create the account first so that old account can be removed first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix AzureAD#335
Require AzureAD#339
Call
remove_accountwhen new account is created.Because old access tokens are purged from the token cache,
acquire_token_silentwill no longer return revoked access tokens.In other words,
remove_accountremove_accountbecause ofskip_account_creation=True