0

We are trying to connect to Microsoft Dynamics from our Azure App Service (Linux) using Windows authentications.

We are getting the issue below even though the same configuration was working well when connecting from Azure Windows VM.

System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate'.**

Code used for initializing a Client:

BasicHttpBinding basicHttpBinding = new BasicHttpBinding();
basicHttpBinding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
basicHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
basicHttpBinding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;
basicHttpBinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
basicHttpBinding.MaxBufferSize = int.MaxValue;
basicHttpBinding.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
basicHttpBinding.MaxReceivedMessageSize = int.MaxValue;
basicHttpBinding.AllowCookies = true;

EndpointAddress endpoint = new EndpointAddress(NavEndpoint);

var navClient = new MyIntegrationClient(basicHttpBinding, endpoint);

NetworkCredential clientCredentials = new NetworkCredential(UserName, Password, Domain);
navClient.ClientCredentials.Windows.ClientCredential = clientCredentials;
navClient.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;           

What are we missing here? and how can we make this authentication works?

stuartd
  • 70,509
  • 14
  • 132
  • 163
H_H
  • 126
  • 2
  • 9

0 Answers0