@@ -94,7 +94,8 @@ async def get_token(
9494 :param str scopes: desired scope for the access token. This credential allows only one scope per request.
9595 For more information about scopes, see
9696 https://learn.microsoft.com/entra/identity-platform/scopes-oidc.
97- :keyword str claims: additional claims required in the token. This credential does not support claims challenges.
97+ :keyword str claims: additional claims required in the token. This credential does not support claims
98+ challenges.
9899 :keyword str tenant_id: optional tenant to include in the token request.
99100
100101 :return: An access token with the desired scopes.
@@ -106,7 +107,7 @@ async def get_token(
106107 """
107108 if claims and claims .strip ():
108109 raise CredentialUnavailableError (f"Fail to get token, please run az login --claims-challenge { claims } " )
109-
110+
110111 # only ProactorEventLoop supports subprocesses on Windows (and it isn't the default loop on Python < 3.8)
111112 if sys .platform .startswith ("win" ) and not isinstance (asyncio .get_event_loop (), asyncio .ProactorEventLoop ):
112113 return _SyncAzureCliCredential ().get_token (* scopes , tenant_id = tenant_id , ** kwargs )
@@ -141,8 +142,9 @@ async def get_token_info(self, *scopes: str, options: Optional[TokenRequestOptio
141142 """
142143 claims_value = options .get ("claims" ) if options else None
143144 if claims_value and claims_value .strip ():
144- raise CredentialUnavailableError (f"Fail to get token, please run az login --claims-challenge { claims_value } " )
145-
145+ raise CredentialUnavailableError (
146+ f"Fail to get token, please run az login --claims-challenge { claims_value } "
147+ )
146148 # only ProactorEventLoop supports subprocesses on Windows (and it isn't the default loop on Python < 3.8)
147149 if sys .platform .startswith ("win" ) and not isinstance (asyncio .get_event_loop (), asyncio .ProactorEventLoop ):
148150 return _SyncAzureCliCredential ().get_token_info (* scopes , options = options )
0 commit comments