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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

ASP.NET MVC: How can I query Dynamics 365 as the logged in user, authenticated with AAD?

(0) ShareShare
ReportReport
Posted on by 35

I'm not sure if this is the best place to ask this question, but it seems to be? I'm creating an ASP.NET MVC website that authenticates with Azure Active Directory. This site will interact with Dynamics 365 entities and I'd like to query and update Dynamics 365 entities with the identity that the user used to log into my site. This is not a multi-tenant application; just an internal tool to help with Dynamics 365 adoption.

I made a post on StackOverflow looking for advice. https://stackoverflow.com/questions/65313201/how-can-i-query-dynamics-365-as-the-logged-in-user-in-an-asp-net-mvc-site-authen

Long story short, I'm using Microsoft.Xrm.Tooling.Connector.CrmServiceClient to connect right now, but this requires a username and password in the connection string and I want to connect with the identity that the user logged in with, but I don't know how to do this. I'm open to changing to a different SDK or package.

I'm having a hard time finding a modern example or documentation that is intended for programmers rather than IT configuration.

When registering the website in Azure, I indicated that the user will need grant permission to interact with Dynamics 365 on their behalf, and I was prompted for this permission when I logged in, but as the programmer, I'm not sure how to actually use this permission.

Any suggestions, documentation links or advice?

I have the same question (0)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans