davidyack / Xrm.Tools.CRMWebAPI

This is an API helper for working with the Common Data Service (CDS) Web API
MIT License
143 stars 73 forks source link

.NET WebApi Authentication with ADFS and OnPremise #63

Closed Mr-Markus closed 6 years ago

Mr-Markus commented 6 years ago

Hi there,

i would like to use this library for an OnPremise Installation with AD FS 3.0, but it doesn't work for me. If I am using somthing like this:

public CRMWebAPI GetAPI()
{
     CRMWebAPI api = new CRMWebAPI("https://server/Instance/api/data/v8.2/", CredentialCache.DefaultNetworkCredentials);
     return api;
}

The HttpResponse is the html of the AD FS page which want me to Login. Is it generally possible in this constelation to use this library and what I have to do that it works?

Thanks for your help Markus

davidyack commented 6 years ago

I believe if you have ADFS involved you would need to enable oAuth - if ADFS is not involved and you just want to use integrated auth what you have should work assuming the default cred user has permissions

Mr-Markus commented 6 years ago

I found out that I need a Windows Server 2016, because it contains AD FS 4.0 which supports oAuth what is needed for WebApi call.

Issue closed with that. Thanks