Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3.01k forks source link

az login fails #18647

Open smithago opened 3 years ago

smithago commented 3 years ago

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

Describe the bug az login -t $tenant -u $username -p $password_raw Get Token request returned http error: 400 and server response: {"error":"invalid_grant","error_description":"AADSTS50126: Error validating credentials due to invalid username or password.\r\nTrace ID: a287413d-c526-4d4a-a6eb-ac9108b03000\r\nCorrelation ID: 7f85270a-1b07-401e-b684-a19533c1b5ea\r\nTimestamp: 2021-06-25 13:16:19Z","error_codes":[50126],"timestamp":"2021-06-25 13:16:19Z","trace_id":"a287413d-c526-4d4a-a6eb-ac9108b03000","correlation_id":"7f85270a-1b07-401e-b684-a19533c1b5ea","error_uri":"https://login.microsoftonline.com/error?code=50126"}

To Reproduce The username and password is correct. I am not sure why az login complains that it is wrong.

Expected behavior Able to login

Environment summary azure-cli 2.10.0

yonzhan commented 3 years ago

@jiasli for awareness

Volatus commented 3 years ago

@smithago When you provide -u $username this is the Service Principal right? See: az login reference

jiasli commented 3 years ago

AADSTS50126: Error validating credentials due to invalid username or password. is returned by AAD service indicating the credential is not correct.