Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

CRM 2016 On Prem - Authentication for Web API - 401 Unauthorized

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

We have a 2016 on-premise that is not configured for IFD.  The development team is attempting to build applications that can utilize the Web API however they are unsuccessful when trying to authenticate.  

CRM 2016 On-Premise

Not configured for IFD

URL Redirects

ADFS claims authentication (forms is not enabled)

I have looked online for documentation about how to connect but I have not found definitive answers.  In the given setup above, what is the method to authenticate?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: CRM 2016 On Prem - Authentication for Web API - 401 Unauthorized

    AuthenticationContext authContext = new AuthenticationContext(_authority, false);

    UserCredential credentials = new UserCredential(_username, _password);

    _authResult = authContext.AcquireToken(_serviceUrl, _clientId, credentials);

  • Inogic Profile Picture
    Inogic 402 on at
    RE: CRM 2016 On Prem - Authentication for Web API - 401 Unauthorized

    Hi EWatson,

    What piece of code or line of code caused the above said issue?
    If in case, you could paste your code snippet, it would help me to narrow down the cause.

    Thanks!
    Sam

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: CRM 2016 On Prem - Authentication for Web API - 401 Unauthorized

    We have attempted to connect (we saw the link you shared) and we are getting {"This method overload is not supported by '_sts1.ourcompany.com/.../&;"}

  • Inogic Profile Picture
    Inogic 402 on at
    RE: CRM 2016 On Prem - Authentication for Web API - 401 Unauthorized

    Hi,

    Try checking the below link, might prove useful to.
    http://www.inogic.com/blog/2016/03/programming-using-webapi-through-c-in-dynamics-crm-2016/ 

    HTH!

    Thanks,

    Sam

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,735 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans