web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Multi-tenant server-to-server authentication - User consent issue

(0) ShareShare
ReportReport
Posted on by

I have followed this walkthrough to create a multi-tenant web application that can connect to Dynamics 365 CE Online. Walkthrough: Multi-tenant server-to-server authentication.

When I ran the app for the first time and tried to sign in to the Dynamics CRM, it asked me to provide a consent that I accepted. And then it returned the below error:

Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException HResult=0x80131500 Message=AADSTS65001: The user or administrator has not consented to use the application with ID 'XXX' named 'MvcCrmStsWalkthrough'. Send an interactive authorization request for this user and resource.   

For subsequent tries, it didn't ask for consent. However, kept returning the aforementioned error.

What I have used for this POC

  • Dynamics CRM Online trial
  • Azure Active Directory service that was included by default with the CRM trial and was enough to perform application registration on Azure AD
  • Visual Studio 2017 community edition (The only difference from what is mentioned in the walkthrough was VS2015)

What I have tried so far

  • In Azure AD I already have granted permission using the 'Grant Permission' button on the registered app Settings > Required Permissions (Seems accepting user consent through my custom app does the same)
  • Setting oauth2AllowImplicitFlow to true in the Azure AD app manifest
  • I verified that the O365 account that I am using to log in through the app has Global Administrator directory role in the AD

Sample code

Exactly the same as mentioned in the walkthrough.

Please help.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Nishant Rana Profile Picture
    11,325 Microsoft Employee on at

    This might help

    nishantrana.me/.../

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Varsha deshpande Profile Picture

Varsha deshpande 5

#2
JS-09031509-0 Profile Picture

JS-09031509-0 3

#3
Ciprian  P Profile Picture

Ciprian P 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans