File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import platform
2+ from pathlib import Path
13import msal
24import os
35from datetime import datetime , timedelta
@@ -415,4 +417,16 @@ def get_auth_provider(
415417 ):
416418 return AuthProviderManaged (resource_id )
417419 # ELSE
420+ lockfile_path = Path .home () / ".config/chromium/SingletonLock"
421+ if Path (lockfile_path ).is_symlink () and not str (
422+ Path (lockfile_path ).resolve ()
423+ ).__contains__ (platform .node ()):
424+ # https://github.com/equinor/sumo-wrapper-python/issues/193
425+ print (
426+ "Chromium lockfile points to another host, "
427+ f"you should delete { lockfile_path } . "
428+ "Falling back to device-code login now"
429+ )
430+ return AuthProviderDeviceCode (client_id , authority , resource_id )
431+ # ELSE
418432 return AuthProviderInteractive (client_id , authority , resource_id )
You can’t perform that action at this time.
0 commit comments