Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ def get_access_token(self, force_refresh: bool = False) -> str:
auth_token = self.__get_msal_app().acquire_token_for_client(
scopes=self.scopes
)

# acquire_token...() returns None if there are no any tokens and
# a dict which contains 'error' in case of error
if auth_token is None:
raise UserWarning("No any access tokens")
if 'error' in auth_token:
raise UserWarning(f"Failed to get access token: {auth_token}")

return auth_token["access_token"]

def __get_msal_app(self):
Expand Down