Skip to content

Commit

Permalink
Don't try to use AuthProviderSilent if there is no token cache file.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwiker committed Sep 18, 2024
1 parent d8d181e commit cb3c102
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/sumo/wrapper/_auth_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,12 @@ def get_auth_provider(
if os.path.exists(get_token_path(resource_id, ".sharedkey")):
return AuthProviderSumoToken(resource_id)
# ELSE
auth_silent = AuthProviderSilent(client_id, authority, resource_id)
token = auth_silent.get_token()
if token is not None:
return auth_silent
if os.path.exists(get_token_path(resource_id, ".token")):
auth_silent = AuthProviderSilent(client_id, authority, resource_id)
token = auth_silent.get_token()
if token is not None:
return auth_silent
pass
# ELSE
if interactive:
return AuthProviderInteractive(client_id, authority, resource_id)
Expand Down

0 comments on commit cb3c102

Please sign in to comment.