Skip to content

az login stuck on connecting to login.microsoftonline.com:443 #28548

Description

@Bouke

Describe the bug

Running az login is stuck after confirmation in the browser. The debug output shows it is waiting to connect to login.microsoftonline.com:443.

My machine is connected to the internet. All browsing works fine. I can connect to login.microsoftonline.com in my Safari browser.

Related command

az login --scope {} --debug

Errors

No error; it is just stuck waiting.

Issue script & Debug output

cli.azure.cli.core.auth.identity: A web browser has been opened at https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`.
msal.telemetry: Generate or reuse correlation_id: c029d9c5-7926-4ab7-adc6-a0de19d2da3f
msal.oauth2cli.oauth2: Using http://localhost:64330 as redirect_uri
msal.oauth2cli.authcode: Abort by visit http://localhost:64330?error=abort
msal.oauth2cli.authcode: Open a browser on this device to visit: https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize?client_id=04b07795-8ddb-461a-bbee-02f9e1bf7b46&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A64330&scope=https%3A%2F%2Fmanagement.azure.com%2F%2F.default+offline_access+openid+profile&state=NmifcZvXTDBFSpPj&code_challenge=(...)
msal.oauth2cli.authcode: Got auth response: (...)
msal.oauth2cli.authcode: "GET /?code=(...) HTTP/1.1" 200 -
urllib3.connectionpool: Starting new HTTPS connection (1): login.microsoftonline.com:443
^Ccli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x10f3e8400>]

Expected behavior

az login should just work

Environment Summary

macOS-14.3.1-x86_64-i386-64bit, Darwin 23.3.0
Python 3.11.8
Installer: HOMEBREW

azure-cli 2.58.0

Extensions:
azure-devops 1.0.0
ssh 1.1.1

Dependencies:
msal 1.26.0
azure-mgmt-resource 23.1.0b2

Additional context

Metadata

Metadata

Assignees

Labels

Accountaz login/accountAuto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamact-identity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions