-
Notifications
You must be signed in to change notification settings - Fork 200
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
[Issue] azd auth login does not use BROWSER env #2291
Comments
MSAL library uses pkg/browser. Related issue here: pkg/browser#41 |
One thing to note is that we use a slightly different package in the implementation of It would be nice perhaps if the MSAL library allowed us to provide some function with a signature like @heaths, one thing to note, is that I think with You could also consider putting some simple |
Thanks. I will give that a try. If xdg-open can be installed minimally and I can do without the |
Update: it was a small install for xdg-utils, yes, but doesn't work. Fortunately, I can work around this using FWIW, without |
Update 2: That said, whether I'm running |
Had the same error this morning on a fresh install of Note, I did also have to use Edit: this was on WSL2 Ubuntu |
FWIW - I opened AzureAD/microsoft-authentication-library-for-go#422 in MSAL to give us the ability to configure what package is used to open the browser. With this change, we should be able to provide an implementation that honors BROWSER before falling back to |
@vhvb1989 can you take care of consuming the above MSAL changes once they are released? |
See #2446 for wsl with ubuntu 22 on win11, azd requires: |
Full instructions for |
This auth flow works in other commands without wslu, though. While that works around the problem, not requiring additional dependencies that similar CLIs e.g., |
I do agree with that. It looks like what AzureAD/microsoft-authentication-library-for-python#332 Something less nice about this is that it takes 4-8 seconds for me:
|
I think we're also supporting |
Odd they choose powershell. It has a slower startup cost. You could instead |
@heaths @weikanglim , it looks like I am setting powershell as the fallback when |
Using wikipedia, with original source, and ss64 as the base reference then conducting my own testing: The special characters seems to be: package main
import (
"fmt"
"os"
"os/exec"
)
func main() {
res, err := exec.Command("cmd.exe", "/C", "start", "http://localhost:8080/?^<^>^|^^^&a=1^&b=2\\()").CombinedOutput()
fmt.Println(string(res))
if err != nil {
fmt.Println(err)
os.Exit(1)
}
} |
Output from
azd version
Run
azd version
and copy and paste the output here: azd version 0.9.0-beta.3 (commit e564b12)Describe the bug
Despite having the
BROWSER
env var defined as "explorer.exe" - a not uncommon practice in WSL2 - I get an error when I try to runazd auth login
:I'd prefer not to install any of these as it pulls in a lot of dependencies I don't need for WSL2, where I do most of my non-C# development.
To Reproduce
export BROWSER="explorer.exe"
azd auth login
Expected behavior
My default browser should open.
Environment
Information on your environment:
* Language name and version: go version go1.20.1 linux/amd64
* IDE and version: none (WSL2)
The text was updated successfully, but these errors were encountered: