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

Can i use ADAL authintication in Dynamics 365 on-premise (2015/2016/8.2/9.0/9.1/9.2)

(0) ShareShare
ReportReport
Posted on by 40

Hi Expert ,

    I am currently using Dynamics 365 CRM Online version and use  Azure Active Directory Authentication Library (ADAL)  for API / Webservice authentication .For this authentication i have to registered my app with Microsoft Azure Active Directory. I am little bit confusion can i use same authentication step for the on-premise versions (2015 / 2016 / 8.2 / 9.0 /9.1/ 9.2) . Below is my code for Crm online which is working fine can i use same code my onpremise versions.

AuthenticationParameters ap = AuthenticationParameters.CreateFromResourceUrlAsync(new Uri(credential.companyUrl)).Result;
var creds = new ClientCredential(credential.clientId, credential.clientSecret);
AuthenticationContext authContext = new AuthenticationContext(ap.Authority);
string token = authContext.AcquireTokenAsync(ap.Resource, creds).Result.AccessToken;

string endPoint = "products?$select= * &$filter=productnumber eq ghj78888";
var httpClient = HttpWebRequest.CreateHttp(Path.Combine("">insyncdemo.api.crm8.dynamics.com/.../", endPoint));

httpClient.Headers.Add(HttpRequestHeader.Authorization, "Bearer " + token);
using (var sr = new StreamReader(httpClient.GetResponse().GetResponseStream()))
{
responseData = sr.ReadToEnd();

}

Thanks

Surajit Kundu

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Holly Huffman Profile Picture

Holly Huffman 103

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 96 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

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

Product updates

Dynamics 365 release plans