2

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.

steffwj
  • 33
  • 4
  • please see the answer to my similar question: http://stackoverflow.com/questions/37454539/using-adal-c-sharp-as-confidential-user-daemon-server-server-to-server-401-u – IntegerWolf Jun 24 '16 at 08:35

0 Answers0