none
.Net Core 2.0 WCF Client Getting error " The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate'." RRS feed

  • Question

  • I have an .Net CORE web api that consumes a WCF service (the service is for AD authentication). My api is hosted in IIS and is working in my development machine however when I deploy it to the server, I get the error

    "fail: Microsoft.AspNetCore.Server.Kestrel[13]
          Connection id "0HLBIV6OE2L27", Request id "0HLBIV6OE2L27:00000001": An unhandled exception was thrown by the application.
    System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate'"

    This was working on the server until we upgraded to the new SDK 2.1.4.

    I have tried suggestions on modifying Reference.cs to set AllowedImpersonationLevel and also adding the following to GetEndpointAddress method:

    result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.TransportCredentialOnly;                result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.Windows;                result.Security.Transport.ProxyCredentialType = System.ServiceModel.HttpProxyCredentialType.None;

    But none of these work.




















































































































































    Tuesday, February 13, 2018 4:12 PM

All replies

  • Hi Jacqueline,

    >>This was working on the server until we upgraded to the new SDK 2.1.4.

    Is this SDK .NET CORE SDK? 

    Do you mean you got this error after installing .NET CORE SDK 2.1.4?

    Could you share us a simple solution and detail steps which could reproduce your issue?

    Best Regards,

    Tao Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, February 15, 2018 7:34 AM