Skip to content

Commit 78c73ad

Browse files
committed
fix: change order of authentication schemes so that an explicitly passed token (refresh or access) is used in preference to anything else.
1 parent ef0d880 commit 78c73ad

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

src/sumo/wrapper/_auth_provider.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -432,17 +432,6 @@ def get_auth_provider(
432432
devicecode=False,
433433
case_uuid=None,
434434
) -> AuthProvider:
435-
if all(
436-
os.getenv(x)
437-
for x in [
438-
"AZURE_FEDERATED_TOKEN_FILE",
439-
"AZURE_TENANT_ID",
440-
"AZURE_CLIENT_ID",
441-
"AZURE_AUTHORITY_HOST",
442-
]
443-
):
444-
return AuthProviderManaged(resource_id)
445-
# ELSE
446435
if refresh_token:
447436
return AuthProviderRefreshToken(
448437
refresh_token, client_id, authority, resource_id
@@ -464,6 +453,17 @@ def get_auth_provider(
464453
return auth_silent
465454
pass
466455
# ELSE
456+
if all(
457+
os.getenv(x)
458+
for x in [
459+
"AZURE_FEDERATED_TOKEN_FILE",
460+
"AZURE_TENANT_ID",
461+
"AZURE_CLIENT_ID",
462+
"AZURE_AUTHORITY_HOST",
463+
]
464+
):
465+
return AuthProviderManaged(resource_id)
466+
# ELSE
467467
if interactive:
468468
lockfile_path = Path.home() / ".config/chromium/SingletonLock"
469469

0 commit comments

Comments
 (0)