az login redirects to localhost instead of authenticating

SKate 136 Reputation points
2022-09-28T18:27:04.567+00:00

When using CLI to login:
az login
the browser opens this page https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize?client_id=clientID&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A55322&scope=https%3A%2F%2Fmanagement.core.windows.net%2F%2F.default+offline_access+openid+profile&state=state&code_challenge=codeChallenge&code_challenge_method=method&nonce=nonce&client_info=1&prompt=select_account

which then redirects me to http://localhost:55322

Expected behavior is to authenticate, and have the CLI available for further use.

This was working yesterday. Was there some kind of update that could have caused this behavior?

The login via device code with
az login --use-device-code
still works.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,854 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Buist, Eric 25 Reputation points
    2023-04-17T15:09:26.1066667+00:00

    This continues to happen, since last Friday. azure-cli 2.47.0 core 2.47.0 telemetry 1.0.8 Dependencies: msal 1.20.0 azure-mgmt-resource 22.0.0 This could be because the CLI runs from within WSL 2, but it was working a week ago. az login still works from Powershell.

    5 people found this answer helpful.

  2. SKate 136 Reputation points
    2022-09-29T15:15:58.863+00:00

    This appears to be resolved today.

    2 people found this answer helpful.

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more