When you are trying to use any Azure services, you might come across this error. You have given the API permissions to an application and now you want to call these services. Following is the complete error you might get.
{
"error": "invalid_grant",
"error_description": "AADSTS65001: The user or administrator has not consented to use the application with ID '' named 'testidtoken'. Send an interactive authorization request for this user and resource.\r\nTrace ID: dd0d4bcd-6177-4677-8816-fefd0f04b500\r\nCorrelation ID: b1758dd1-84fc-447e-a540-9dcf84377817\r\nTimestamp: 2021-07-19 19:14:13Z",
"error_codes": [
65001
],
"timestamp": "2021-07-19 19:14:13Z",
"trace_id": "dd0d4bcd-6177-4677-8816-fefd0f04b500",
"correlation_id": "b1758dd1-84fc-447e-a540-9dcf84377817",
"suberror": "consent_required"
}
The exact problem can be seen in the error itself. Whenever, you add API permissions, there are some permissions that requires Admin Consent.
To fix this, ask your AAD Admin to go to Azure Active Directory -> App Registrations. Click on the application for which the admin consent is required. Click on API permissions.
Click on Grant admin consent
. This option will only be enabled for admins.

Leave a Reply