Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to setup access to Dynamics CRM Web API with an IFD deployment

(0) ShareShare
ReportReport
Posted on by

I have read a lot of web articles on the above subject.

I want to write some C# applications to work with Dyanmics CRM Web API

On our ADFS server we have run the powershell script

Add-AdfsClient -ClientId xxxxxxxxxxx -Name test1 -RedirectUri https://xxxx.yyyy.com.au/

We use office 365 for our email and sharepoint services

It appears that I need to setup Azure Active Directory. I am not quite sure what to do in this setup. Most of the web articles reference CRM Online so I am not sure for our IFD deployment exactly what to do. In Azure AD admin center I see things like "Enterprise applications" and "App registrations"

Is there a good document that shows the steps to setup Web API in an IFD deployment so a C# application can authenticate successfully?

*This post is locked for comments

  • Verified answer
    Kokulan Profile Picture
    18,052 on at
    RE: How to setup access to Dynamics CRM Web API with an IFD deployment

    Hi

    On top of what is already being suggested, visit these links as well

    stackoverflow.com/.../authorize-webapp-to-adfs-in-order-to-acc

    stackoverflow.com/.../authenticate-to-dynamics-365-on-premise

    github.com/.../simple-web-api-quick-start-sample-csharp.md

  • Verified answer
    Community Member Profile Picture
    on at
    RE: How to setup access to Dynamics CRM Web API with an IFD deployment

    Hi Gavin,

    I will explain the step to register your app.


    First of all Please follow the steps provided in the below link.

    docs.microsoft.com/.../walkthrough-register-app-active-directory

    ==================================================================

    1) Add-AdfsClient -ClientId 00000000-0000-0000-0000-000000000000 -Name AppName_WebApi -RedirectUri "https://dev.domain.com/","dev1.domain.com:portnumber/"

    2) Grant-AdfsApplicationPermission -ClientRoleIdentifier 00000000-0000-0000-0000-000000000000 -ServerRoleIdentifier auth.domain.com:portnumber/ -ScopeNames openid

    3) Set-AdfsRelyingPartyTrust -TargetName "External CRM" -IssueOAuthRefreshTokensTo AllDevices

    portnumber is not mandatory*, if you have port number please include that.


    Note: "External CRM" is the name of relying party Trust Display Name

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,865 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,723 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans