Skip to content

Running az login from a remote ubuntu server pops up asking to authenticate in local brower; Ends up with localhost URL #26556

Description

@NipunaPrashan

Describe the bug

Running az login from a remote ubuntu server pops up asking to authenticate in local machine browser. After successful login browser redirects to a localhost URL with a random port. This does not complete the authentication.

Related command

az login

Errors

the commandline hangs with this, because browser cannot complete the authentication.

Issue script & Debug output

az login --debug

cli.knack.cli: Command arguments: ['login', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
...
open, use device code flow with az login --use-device-code.
msal.telemetry: Generate or reuse correlation_id: 41ef23e9-e5ab-42c8-89b8-92892ba5a570
msal.oauth2cli.oauth2: Using http://localhost:38149 as redirect_uri
msal.oauth2cli.authcode: Abort by visit http://localhost:38149?error=abort

Expected behavior

I doubt about the redirect URL.

Environment Summary

azure-cli 2.49.0

core 2.49.0
telemetry 1.0.8

Dependencies:
msal 1.20.0
azure-mgmt-resource 22.0.0

Python location '/opt/az/bin/python3'
Extensions directory '/home/nipuna/.azure/cliextensions'

Python (Linux) 3.10.10 (main, May 19 2023, 08:20:32) [GCC 9.4.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Assignees

Labels

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