-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
acquire_token_interactive
cannot open web browser on WSL2 + Ubuntu 22.04
#628
Comments
I'm reopening this as it is a bug in MSAL. MSAL is expected to get this to work with WSL. Let's keep the bug open with the tag "External" if we expect the WSL team to fix this. Root cause: microsoft/WSL#8892 |
Since the lack of browser support is on WSL, and the lack of browser detection is on Python language, there is perhaps only one thing left that MSAL Python can do. Proposal: If Two differences between the existing-but-undocumented API (which I mentioned to @jiasli the other day) and this new not-yet-implemented proposal:
|
The login process in the browser can easily exceeds 10s, especially when MFA is involved. |
Good point. We may use a longer value, such as 30 seconds, if not longer. By that time, even if the user was still busy doing MFA, seeing such a hint message shall still be considered understandable and acceptable. |
Copied from microsoft/WSL#8892 (comment) Without $ sudo apt remove xdg-utils
$ sudo apt install python3.11
$ python3.11 -c "import webbrowser; print(webbrowser.open('https://login.microsoftonline.com/'))"
True
gio: https://login.microsoftonline.com/: Operation not supported |
For what it's worth, I chatted with a Python core developer who confirms that we shouldn't rely on the undocumented return value of If, for example, Azure CLI would like to explore detecting browser on WSL, that effort and its outcome shall go to upstream Python standard library. |
I personally don't think this is a good user experience. Imagine you have to wait 30 seconds before you know what to do next. As Azure CLI developer, I would rather show the hint message unconditionally if WSL is detected:
Azure CLI has a function MSAL copied the logic from Azure CLI (8d86917):
|
Discussed in #627
Originally posted by jiasli November 16, 2023
Describe the bug
acquire_token_interactive
cannot open web browser on WSL2 + Ubuntu 22.04. The upstream issue is microsoft/WSL#8892.To Reproduce
Additional context
Windows Terminal supports Ctrl+Click to open hyperlinks, so the user can Ctrl+Click the URL after
xdg-open: no method available for opening
to open the web browser and the rest steps work as usual.The text was updated successfully, but these errors were encountered: