Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Web API Sample - Invalid Authentication Header Format

  • 1.  Web API Sample - Invalid Authentication Header Format

    Posted Mar 02, 2020 12:35 PM
    I'm working my way through the MSDN example https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/quick-start-console-app-csharp for testing the CRM Web API.

    The CreateFromResourceUrlAsync() call is returning an Invalid authenticate header format exception and I'm not sure why.

    When I navigate to the URL that the sample builds I get the login prompt (as expected?).

    The only thing I can figure is that the version in the sample is newer (9.0+). The version of CRM I'm working with is 8.2.

    Thoughts?

    #CustomerEngagement
    #CRM2016​​
    #Technical

    ------------------------------
    Tim Neau
    Systems Developer
    Federated Insurance
    Owatonna MN
    ------------------------------
    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 2.  RE: Web API Sample - Invalid Authentication Header Format

    Posted Mar 02, 2020 03:26 PM
    Edited by Tim Neau Mar 02, 2020 03:26 PM
    Based on another MSDN entry it appears our CRM isn't using OAuth (https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/webapi/web-api-helper-code-authentication-class). In the try-catch it has a case for the error I'm getting and states that it occurs if the service is not configured for OAuth.

    So the next challenge - how do I enable a user to have access to the Web API?

    Is it a specific permission for the user, or a configuration in CRM?

    ------------------------------
    Tim Neau
    Systems Developer
    Federated Insurance
    Owatonna MN
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


If you've found this thread useful, dive deeper into User Group community content by role