Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Identity] AADSTS9002313: Invalid request. Request is malformed or invalid. #21758

Closed
mikeharder opened this issue Jun 9, 2021 · 0 comments · Fixed by #22087
Closed

[Identity] AADSTS9002313: Invalid request. Request is malformed or invalid. #21758

mikeharder opened this issue Jun 9, 2021 · 0 comments · Fixed by #22087
Assignees
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library.

Comments

@mikeharder
Copy link
Member

I was getting the following exception when using DefaultAzureCredential:

Unhandled exception. Azure.Identity.AuthenticationFailedException: Azure CLI authentication failed due to an unknown error. CLIInternalError: The command failed with an unexpected error. Here is the traceback:
Get Token request returned http error: 400 and server response: {"error":"invalid_grant","error_description":"AADSTS9002313: Invalid request. Request is malformed or invalid.\r\nTrace ID: bb605d03-a3a5-44c6-95a7-76f523940000\r\nCorrelation ID: 54e3890f-28ae-44da-b69d-9ecdaa0b3091\r\nTimestamp: 2021-06-09 21:50:12Z","error_codes":[9002313],"timestamp":"2021-06-09 21:50:12Z","trace_id":"bb605d03-a3a5-44c6-95a7-76f523940000","correlation_id":"54e3890f-28ae-44da-b69d-9ecdaa0b3091","error_uri":"https://login.microsoftonline.com/error?code=9002313"}

It also repro'd using the following code:

var cred = new AzureCliCredential();
var token = cred.GetToken(new TokenRequestContext(new[] { "https://storage.azure.com/.default" }), default);

Or when running CLI command az account get-access-token.

I was able to fix it by running az login again. I have no idea what caused my az cli login to be corrupted (or whatever happened here).

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jun 9, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jun 10, 2021
@jsquire jsquire added the Client This issue points to a problem in the data-plane of the library. label Jun 10, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants