Dynamics CRM Online 2016 - Daemon / Server application Azure AD authentication error to Web Api

可紊 提交于 2019-12-10 22:34:56

问题


I am building a C# windows service that needs to connect to the Microsoft Dynamics CRM Web API. I am using the example code from github "A .NET 4.5 daemon application that uses a certificate to authenticate with Azure AD and get OAuth 2.0 access tokens, Github".

I am able to retrieve an access token from AAD, however, when I call the Dynamics CRM resource i get the following error:

HTTP Error 401 - Unauthorized: Access is denied

StatusCode: 401, ReasonPhrase: 'Unauthorized', Version: 1.1,

WWW-Authenticate: Bearer error=invalid_token, error_description=Error during token validation!,

I have also tried using client id and client key, but I get the same error.

Any help would be highly appreciated. Thank you very much.

来源:https://stackoverflow.com/questions/36171276/dynamics-crm-online-2016-daemon-server-application-azure-ad-authentication-e

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!