Hi,
I am trying to access Dynamics CRM online using Web API, with authentication using the OAUTH 2.0 from Azure AD. Here is what I have done so far.
1. Registered my application in Azure AD in the App Registration.
2. Successfully authorize using https://login.microsoftonline/common end point. I am getting an Access Token and Refresh Token properly. I am also able to use the refresh token and get a new token. The resource I am passing to these is the Client ID of the application I registered.
3. I also configured Dynamics CRM Online (Microsoft.CRM) in the Required Permissions section of the application I registered.
Now, when I access Dynamics using the https://<mydomain>.crm.dynamics.com end point and access a resource (such as Account), I get a (401) Unauthorized error. This happens even with Postman application.
I have followed the steps in https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-code
I also see another set of document - https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-service-to-service
Is this relevant here for my use?
Thanks!
Venkat Rangan
*This post is locked for comments
Sorry, I figured that the problem was the missing https:// before mydomain in scope.
Now that I fixed it, I get a new error:
Correlation ID: 24bcd582-4bf7-4b80-8734-114387021b4f
Timestamp: 2017-10-06 20:48:15Z
AADSTS70001: Application '<application-id>' is not supported for this API version.
What is this referring to? Thanks!
I also tried following the article: docs.microsoft.com/.../active-directory-v2-protocols-oauth-code
The step "Request an authorization code" works fine for the Tutorial Sample App, but when I substitute my client_id and scope I get an an error:
login.microsoftonline.com/.../authorize;response_type=code&redirect_uri=http%3A%2F%2Flocalhost%2Fmyapp%2F&response_mode=query&scope=mydomain.crm.dynamics.com&state=12345
Error:
AADSTS70011: The provided value for the input parameter 'scope' is not valid. The scope mydomain.crm.dynamics.com is not valid.
How do I specify the "scope" parameter for Dynamics CRM?
Thanks, again!
The error I get is:
{
"error": "invalid_resource",
"error_description": "AADSTS50001: The application named domain.crm.dynamics.com was not found in the tenant named domain.onmicrosoft.com. 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: fa87946e-c42c-4f1f-a595-dfd806403900\r\nCorrelation ID: d62d5c76-9c54-43d1-8a07-5b4d36ff7908\r\nTimestamp: 2017-10-06 17:38:35Z",
"error_codes": [
50001
],
"timestamp": "2017-10-06 17:38:35Z",
"trace_id": "fa87946e-c42c-4f1f-a595-dfd806403900",
"correlation_id": "d62d5c76-9c54-43d1-8a07-5b4d36ff7908"
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156