Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException: ‘AADSTS65001: The user or administrator has not consented to use the application error in Dynamics 365 CE


Suppose, we have just registered an application in Azure Active Directory and trying to acquire the token and get the below error

Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException: ‘AADSTS65001: The user or administrator has not consented to use the application with ID ‘b2c5028d-57e6-4df7-9940-828e6914948b’ named ‘MyApp’. Send an interactive authorization request for this user and resource.

This is because admin consent is required before the application can be used. This could be granted by global administrator.

One of the ways to do so is through the URL with the specific format as shown below

https://login.microsoftonline.com/[tenantid]/oauth2/authorize?client_id=[appId]&response_type=code&redirect_uri=[redirctURL]&resource=[resourceURL]&prompt=admin_consent


Pasting this URL in the browser will prompt for the credential, login will global administrator and we will be presented with the following consent box

Clicking on Accept will grant the required permission to the application registered.

Hope it helps..

Advertisements

Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

2 thoughts on “Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException: ‘AADSTS65001: The user or administrator has not consented to use the application error in Dynamics 365 CE”

Please share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.