File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -926,12 +926,9 @@ def _acquire_token_silent_by_finding_specific_refresh_token(
926926 logger .debug ("Cache attempts an RT" )
927927 response = client .obtain_token_by_refresh_token (
928928 entry , rt_getter = lambda token_item : token_item ["secret" ],
929- on_removing_rt = (rt_remover or self .token_cache .remove_rt )
930- if # we can remove a RT when a single scope is an exact match
931- len (scopes ) == 1
932- and set (entry .get ("target" , "" ).split ()) <= set (scopes )
933- else # otherwise keep the RT as it might work for a subset of scopes
934- lambda rt_item : None , # No OP
929+ on_removing_rt = lambda rt_item : None , # Disable RT removal,
930+ # because an invalid_grant could be caused by new MFA policy,
931+ # the RT could still be useful for other MFA-less scope or tenant
935932 on_obtaining_tokens = lambda event : self .token_cache .add (dict (
936933 event ,
937934 environment = authority .instance ,
You can’t perform that action at this time.
0 commit comments