We have an existing solution with ASP .NET Core and Angular frontend, with our own user management. Now I want to implement registration and login with Azure Active Directory.
I've successfully set up the AD application and the frontend logic to acquire the code. Then I pass it to our backend, to generate a token together with the secret. When calling the /oauth2/token endpoint, I get this error
{
"error": "invalid_grant",
"error_description": "AADSTS9002313: Invalid request. Request is malformed or invalid.\r\nTrace ID: 0a741bc7-c4a7-4699-af50-4e95a5690b00\r\nCorrelation ID: b83b609c-7cdc-4ad6-ae88-6aa07b4243f8\r\nTimestamp: 2020-05-22 19:22:24Z",
"error_codes": [
9002313
],
"timestamp": "2020-05-22 19:22:24Z",
"trace_id": "0a741bc7-c4a7-4699-af50-4e95a5690b00",
"correlation_id": "b83b609c-7cdc-4ad6-ae88-6aa07b4243f8",
"error_uri": "https://login.microsoftonline.com/error?code=9002313"
}
I could reproduce the problem with Postman. I tried the tenantid (Guid) as well as the name xxx.onmicrosoft.com






