Skip to content

sb.get_token() is not opening browser on Windows 11 #52

@wzell-usgs

Description

@wzell-usgs
sb = sciencebasepy.SbSession()
sb.get_token()

echoes the expected output:

A browser window/tab should momentarily open with ScienceBase Manager
Sign in using active directory or login.gov
Click the user icon in the upper right and select 'Copy API token'
This copies the token to your clipboard
Use this value in the add_token function as the token_json parameter

However, no browser window/tab opens.

This appears to be because of an issue with my machine (Windows 11) not recognizing a default browser, including not retaining it after I set it in Settings/Apps/Default Apps, or not registering it in a way that the Python webbrowser package (which sb.get_token() calls) can detect. This behavior began after my machine was re-imaged. The resolution will require something with the OS settings.

Posting the issue in case anyone else experiences it.
Workaround: manually open a new tab at https://sciencebase.usgs.gov/manager/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions