Replies: 9 comments 2 replies
-
Thanks for bringing this to our attention. If the end user is aware that they are using "WSL2 + Ubuntu22.04", installing From Azure CLI's perspective, it is lucky that last line of error provides a visible URL:
So, perhaps Azure CLI can reword the first line in your screenshot:
|
Beta Was this translation helpful? Give feedback.
-
Btw, MSAL.NET added support for several other tools for opening browser on Linux, apart from xdg-open: https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/blob/main/src/client/Microsoft.Identity.Client/Platforms/netcore/NetCorePlatformProxy.cs#L236 Not sure it'll fix the issue here, as |
Beta Was this translation helpful? Give feedback.
-
@bgavrilMS , is there an MSAL .Net test app for @jiasli to test the MSAL .Net behavior and see if that helps? Regardless, I do not think this is a bug. At least not in MSAL Python. Python has a built-in module This was working before, so it feels like a regression on WSL. Anyway, the "p2" and "bug" labels got my attention. @jiasli , you can ping me offline for an alternative solution, which will still be in the direction of my earlier suggestion of refining Azure CLI's error message. But I can tell you an undocumented API that would be triggered only when browser is unavailable. |
Beta Was this translation helpful? Give feedback.
-
The Ubuntu 22.04 on my another computer doesn't have
On Python 3.10, $ /usr/bin/python3 -V
Python 3.10.12
$ /usr/bin/python3 -c "import webbrowser; print(webbrowser.open('https://login.microsoftonline.com/'))"
False This makes 8d86917 kick in, triggering the logic we added for Ubuntu 18.04 (#333). But on Python 3.11 (which Azure CLI 2.54.0 DEB package bundles), $ /opt/az/bin/python3 -V
Python 3.11.5
$ /opt/az/bin/python3 -c "import webbrowser; print(webbrowser.open('https://login.microsoftonline.com/'))"
True
gio: https://login.microsoftonline.com/: Operation not supported
If you are referring to microsoft-authentication-library-for-python/msal/oauth2cli/authcode.py Lines 289 to 311 in 3702816 but the tricky thing is that in my above examples, you can see |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Thanks for your investigation, @jiasli ! Admittedly, Python's
If necessary, MSAL Python could add a mechanism to return the full url via some callback, for downstream app to unconditionally print it, so that the end user would have a chance to know thus manually open it. But the user experience would be really bad, because the url is lengthy and being displayed all the time. So, overall, I agree with your assessment that MSAL not changing the behaviors specially for an upstream WSL issue that will likely be fixed in the future. Shall we close this issue (as Not Planned), then? |
Beta Was this translation helpful? Give feedback.
-
Well. That depends on you. I am opening this issue only for tracking purpose and increasing the visibility of microsoft/WSL#8892. I also created one for Azure CLI: Azure/azure-cli#27879. |
Beta Was this translation helpful? Give feedback.
-
So, we already have a triage conclusion as above. Now, in terms of keep an issue open for indefinite time for tracking purpose, I think in this MSAL Repo we have been experimenting using Github Discussion Q&A for this kind of purpose. I'm converting this issue into a Q&A. |
Beta Was this translation helpful? Give feedback.
-
I don't understand all the above - however it all worked until a few days ago. I could issue Now I have to use |
Beta Was this translation helpful? Give feedback.
-
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.Beta Was this translation helpful? Give feedback.
All reactions