Azure / azure-cli

Azure Command-Line Interface
MIT License
3.98k stars 2.96k forks source link

az login never happens even after disabling all the security tools #24590

Open sesa577179 opened 1 year ago

sesa577179 commented 1 year ago

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Related command

Describe the bug

To Reproduce

Expected behavior

Environment summary

az-cli-login-cmd

Additional context

az-cli-login

The login never happens after I installed the latest version of AZ CLI (2.42.0), downloaded from the official site.

After the security code is generated, the prompt remains forever like shown in the image.

yonzhan commented 1 year ago

@jiasli for awareness

dylanw-oss commented 1 year ago

I encountered a similar issue on wsl2, there are no outputs and no browser opened. (update, it took a long time then it showed output but no browser opened)

dylanw-oss commented 1 year ago

I use this as a workaround, 'az login --use-device-code'

sesa577179 commented 1 year ago

@dylanw-oss but this is a workaround, and not a solution. I could use the device code to login. But it is a genuine issue which we have to accept.

bebound commented 1 year ago

I can't reproduce.

The error image indicates that your browser failed to open locahost:3565 as https page. In fact, it's a http page. Can you copy the url to see if it's http or https? I guess it's a browser or anti-virus app setting problem.

sesa577179 commented 1 year ago

@bebound I tried both HTTP and HTTPS with the same port, after disabling the firewall, anti-virus and all other software. I had the same error.

bebound commented 1 year ago

@sesa577179 When the page redirect to localhost:xxxxx, if you copy the url from address bar, it starts with http or https?

sesa577179 commented 1 year ago

It starts with http.

bebound commented 1 year ago

Maybe your browser used to open another https://localhost page, and bowser remember it as a HTTPS website.

Can you clear the browser cache using below method and try again? https://stackoverflow.com/a/60561350/2251785

duplicate of https://github.com/Azure/azure-cli/issues/10426