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 :
Microsoft Dynamics CRM (Archived)

CRM 2016 On Premise (8.1.0.359) Web Api Access using AzureAD

(1) ShareShare
ReportReport
Posted on by

Hey Team, 

I am trying to access Microsoft CRM Dynamics 2016 On Premise using the Web Api, however so far I haven't had any luck. 

What I have done so far:

  • Registered an application in AzureAD
  • Added permissions to the Application for "Dynamics CRM Online (Microsoft.CRM)"
  • Pressed "Grant Permissions"
  • Tried to get a bearer token using postman.

This leaves me with 2 problems.

  1. I am not sure if I should post to "https://login.microsoftonline.com/common/oauth2/token" or to https://login.microsoftonline.com/{tenantID}/oauth2/token
  2. Both times I get the same error: 
    post-common.PNG

Any help is most welcome, I am wondering if I should install an extension in order to get this to work? (like this: https://msdn.microsoft.com/en-gb/library/gg309276.aspx).

Regards,

Lars

*This post is locked for comments

I have the same question (0)
  • ansrikanth Profile Picture
    3,115 on at

    Hi, CRM 2016 OnPrem with IFD ?? or windows authentication ? From where you are planning to access the WebApi ? If it is Windows authentication, then API should automatically get authenticated with the windows creds. Isn't that working for you ?

  • Community Member Profile Picture
    on at

    Hey Srikanth Alluri, thanks for your quick response! In this case it concerns On Premise with IFD. I am trying to access the WebApi from the Azure AD using OAUTH.  But I get the following error:  (see also screenshot in OP).

    {"error":"invalid_resource","error_description":"AADSTS50001: The application named 3b14036c-844f-xxxx-xxxx-xxxxxxxx was not found in the tenant named 414e2611-xxxx-427a-xxxxx-xxxxxxx. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant.\r\nTrace ID: 4898433e-3e7a-4f76-9ac1-686d82866803\r\nCorrelation ID: 07988a79-cd65-4bb0-a7aa-ca7d952eb1b1\r\nTimestamp: 2017-03-14 08:51:12Z","error_codes":[50001],"timestamp":"2017-03-14 08:51:12Z","trace_id":"4898433e-3e7a-4f76-9ac1-686d82866803","correlation_id":"07988a79-cd65-4bb0-a7aa-ca7d952eb1b1"}

    Regards

  • ansrikanth Profile Picture
    3,115 on at

    It looks like the Resource URL you are using to get access is causing the problem, May I know how you are getting the resource URL to generate the Token? Also, Is this a Native app or a web app/api ? Can you see if ansrikanth.com/.../connect-to-dynamics-crm-365-webapi-from-console-application can help you in any way ?

  • Community Member Profile Picture
    on at

    Thank for your reply, I have just verified everything, and I do think I entered the correct resource. (I did experiment with different ones though). 

    See the screenshot below for the Azure registration:

    1731.crm.PNG

    1731.crm.PNG

    I am trying to gain access in a web api kinda fashion.

    Thanks for your effort, regards!

  • Community Member Profile Picture
    on at

    Bump, any help is much appreciated!

  • Community Member Profile Picture
    on at

    As Resource I did also try "company.crm.dynamics.com"

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans