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

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

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 137 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 57

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans