Skip to content

Commit

Permalink
TokenExchange/ClientAssertionCredential
Browse files Browse the repository at this point in the history
  • Loading branch information
chlowell committed Aug 9, 2021
1 parent 71c8f19 commit a572786
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ def __init__(self, tenant_id, client_id, get_assertion, **kwargs):
self._client = AadClient(tenant_id, client_id, **kwargs)
super(ClientAssertionCredential, self).__init__(**kwargs)

def __enter__(self):
self._client.__enter__()
return self

def __exit__(self, *args):
self._client.__exit__(*args)

def close(self):
# type: () -> None
self.__exit__()

def _acquire_token_silently(self, *scopes, **kwargs):
# type: (*str, **Any) -> Optional[AccessToken]
return self._client.get_cached_access_token(scopes, **kwargs)
Expand Down

0 comments on commit a572786

Please sign in to comment.