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 :
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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Syed Aqib Raza Profile Picture

Syed Aqib Raza 125

#2
ParthPatel249 Profile Picture

ParthPatel249 87

#3
11manish Profile Picture

11manish 85 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans