Hello
I get this message bellow infrequently when I invoke web service in crm plugin after creating or updating record.
Unexpected exception from plug-in (Execute): System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate,NTLM'
this is my web server binding configuration
<bindings> <basicHttpsBinding> <binding> <security mode="Transport"> <transport clientCredentialType="Windows"> <extendedProtectionPolicy policyEnforcement="Always"></extendedProtectionPolicy> </transport> <message clientCredentialType="UserName"/> </security> </binding> </basicHttpsBinding> </bindings>
And I called it from plugin :
BasicHttpsBinding binding = new BasicHttpsBinding(); binding.Name = "BasicHttpsBinding_IServiceIntegration"; binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows; binding.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.Windows; binding.Security.Mode = BasicHttpsSecurityMode.Transport; EndpointAddress myEndpoint = new EndpointAddress("https://myurlwebservice/ServiceIntegration.svc"); ServiceClient = new ServiceIntegrationClient(binding, myEndpoint); ServiceClient.ClientCredentials.Windows.ClientCredential.Domain = "domain"; ServiceClient.ClientCredentials.Windows.ClientCredential.UserName = "user name"; ServiceClient.ClientCredentials.Windows.ClientCredential.Password = "password";
The IIS server configuration
Thanks in advance
*This post is locked for comments
Hi BEN,
Could you please check below references - may be your issue will resolve.
stackoverflow.com/.../the-http-request-is-unauthorized-with-client-authentication-scheme-negotiate
Hope this helps . Good luck.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156