Skip to main content

Notifications

Customer Service forum

KingswaySoft D365 Web API OAuth - (401) Unauthorized

Posted on by Microsoft Employee
I'm using KingswaySoft (v10.2) and SSIS to migrate data to D365 (v9.1) for Customer Service (cloud version)
I'm getting the following error from Kingswaysoft in my SSIS package after roughly 1 hour of successful execution - this includes successful record insertion into D365 during this initial 1 hour. This happens every time and I'm not sure how to fix. If I restart my SSIS package then it will happily continue executing for another hour and the error will occur again.
[Dynamics CRM Destination 1 [1955]] Error: An error occurred with the following error message: "KingswaySoft.IntegrationToolkit.DynamicsCrm.CrmServiceException: CRM service call returned an error: CRM service call returned an error: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Bearer authorization_uri=login.microsoftonline.com/.../authorize, resource_id=xxxxxxxx.crm6.dynamics.com'. (SSIS Integration Toolkit for Microsoft Dynamics 365, v10.2.0.6982 - DtsDebugHost, v13.0.1601.5)KingswaySoft.IntegrationToolkit.DynamicsCrm.CrmServiceException
: CRM service call returned an error: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Bearer authorization_uri=login.microsoftonline.com/.../authorize, resource_id=xxxxxxxx.crm6.dynamics.com'.System.ServiceModel.Security.MessageSecurityException
: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Bearer authorization_uri=login.microsoftonline.com/.../authorize, resource_id=xxxxxxxx.crm6.dynamics.com'.System.Net.WebException
(Status Reason: Unauthorized): The remote server returned an error: (401) Unauthorized.".
 
I suspect that the issue is with the OAuth token expiry in Azure AD. If so, I thought KingswaySoft would automatically renew the token?
I'm using the following connection properties on my KingswaySoft connection.
4137.kingswaysoftsettings.png

Thanks for considering my question and any support you can provide!
  • Daniel Cai Profile Picture
    Daniel Cai 935 on at
    RE: KingswaySoft D365 Web API OAuth - (401) Unauthorized

    Hi Eric, please go ahead upgrade to the new version, the fix should be in the release. We have just updated our release notes to have it reflected there. Thanks for bringing this to my attention.

  • Daniel Cai Profile Picture
    Daniel Cai 935 on at
    RE: KingswaySoft D365 Web API OAuth - (401) Unauthorized

    This is fixed in our v11.1 release. Let me check with the team why it has been missed in the release notes. 

  • Eric benco Profile Picture
    Eric benco 320 on at
    RE: KingswaySoft D365 Web API OAuth - (401) Unauthorized

    @daniel  I see 11.1 has been released to the public, but I don't see this fix in the release notes.  should I continue to use the Beta ?

  • Sara I Profile Picture
    Sara I 5 on at
    RE: KingswaySoft D365 Web API OAuth - (401) Unauthorized

    Having a similar issue with CRM 2016 on-premise. SOAP connection works perfectly fine, but Web API connection returns an error when populating the Organization drop box. Know where we can get some assistance?

  • Daniel Cai Profile Picture
    Daniel Cai 935 on at
    RE: KingswaySoft D365 Web API OAuth - (401) Unauthorized

    Hi Eric, please reach out to us through email so that we can assist you from there. We don't generally publish the links to our temporary build on public forum (even if it may apply to you).

  • Eric benco Profile Picture
    Eric benco 320 on at
    RE: KingswaySoft D365 Web API OAuth - (401) Unauthorized

    @daniel has this problem been resolved yet?  If so where would I download the latest version ?

  • Daniel Cai Profile Picture
    Daniel Cai 935 on at
    RE: KingswaySoft D365 Web API OAuth - (401) Unauthorized

    Hi, we have identified the source of the issue (it was a tricky one). If you are experiencing the issue, please reach out to our support team, and we will provide you a temporary build which should help resolve the issue. 

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: KingswaySoft D365 Web API OAuth - (401) Unauthorized

    As an interim workaround I have reverted to the old web service method until this gets resolved.

    7674.image.png

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans