AADSTS65001: The user or administrator has not consented to use the application

Rithi Ramji 21 Reputation points Microsoft Employee
2021-09-09T07:53:49.177+00:00

Using a native client app , we are calling a middler tier service which is also registered in AAD. This middle tier service internally takes dependencies on other apps. Recently added a new web resource to be accessed by the middle tier service in API permissions. Admin consent not required and user can consent all apps in User consent settings.

Consistently getting the following error -
Send an interactive authorization request for this user and resource.\r\nTrace ID: f206e1a8-7a3c-4b9d-8918-3f23e7611100\r\nCorrelation ID: 3012cab0-8e6e-452d-9a9b-ce297a5d084b\r\nTimestamp: 2021-09-09 07:28:21Z"

Also tried to consent through following code but not seeing the newly added permissions to the Middle Tier service.

AuthenticationResult authResult = authenticationContext.AcquireTokenAsync(
Audience,
NativeAppClientId,
new Uri(NativeAppRedirectUrl),
new PlatformParameters(PromptBehavior.Auto),
UserIdentifier.AnyUser,
"prompt=consent").GetAwaiter().GetResult();

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

Answer accepted by question author
  1. Marilee Turscak-MSFT 37,246 Reputation points Microsoft Employee Moderator
    2021-09-10T23:04:53.03+00:00

    Make sure you have followed the steps to grant admin consent. You can do this under Application > API permissions > Grant admin consent.

    If your app needs user consent, you can construct a consent URL like this:

    https://login.microsoftonline.com/{tenant-id}/adminconsent?client_id={client-id}

    7 people found this answer helpful.
    0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Ahmed Saeed 0 Reputation points
    2024-06-24T13:17:26.4966667+00:00

    check if the status of the permissions is granted for <your organization>

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.