File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -1552,12 +1552,8 @@ def _acquire_token_silent_from_cache_and_possibly_refresh_it(
1552
1552
correlation_id = correlation_id ,
1553
1553
auth_scheme = auth_scheme ,
1554
1554
** data )
1555
- if response : # Broker provides a decisive outcome
1556
- account_was_established_by_broker = account .get (
1557
- "account_source" ) == _GRANT_TYPE_BROKER
1558
- broker_attempt_succeeded_just_now = "error" not in response
1559
-
1560
- if (response .get ("access_token" ) and force_refresh ):
1555
+
1556
+ if (force_refresh and response .get ("access_token" )):
1561
1557
at_to_renew = response .get ("access_token" )
1562
1558
response = _acquire_token_silently (
1563
1559
"https://{}/{}" .format (self .authority .instance , self .authority .tenant ),
@@ -1570,6 +1566,11 @@ def _acquire_token_silent_from_cache_and_possibly_refresh_it(
1570
1566
auth_scheme = auth_scheme ,
1571
1567
at_to_renew = at_to_renew ,
1572
1568
** data )
1569
+
1570
+ if response : # Broker provides a decisive outcome
1571
+ account_was_established_by_broker = account .get (
1572
+ "account_source" ) == _GRANT_TYPE_BROKER
1573
+ broker_attempt_succeeded_just_now = "error" not in response
1573
1574
1574
1575
if account_was_established_by_broker or broker_attempt_succeeded_just_now :
1575
1576
return self ._process_broker_response (response , scopes , data )
You can’t perform that action at this time.
0 commit comments