Unauthorized Archives : Binary Bits https://blog.binarybits.net/tag/unauthorized/ Bits & Pieces - A blog by Kannan Balasubramanian Sat, 04 Aug 2012 12:41:44 +0000 en-GB hourly 1 https://wordpress.org/?v=6.5.2 The HTTP request is unauthorized with client authentication scheme ‘Ntlm’. The authentication header received from the server was ‘NTLM’ https://blog.binarybits.net/the-http-request-is-unauthorized-with-client-authentication-scheme-ntlm-the-authentication-header-received-from-the-server-was-ntlm/ https://blog.binarybits.net/the-http-request-is-unauthorized-with-client-authentication-scheme-ntlm-the-authentication-header-received-from-the-server-was-ntlm/#respond Sat, 04 Aug 2012 07:31:01 +0000 https://blog.binarybits.net/?p=243 For one of the SharePoint implementation I was suppose to call the SharePoint 2010 ASMX service within a Custom WCF services hosted in a different server than the SharePoint 2010 host. So as usual I added the service reference (PS: The add web reference is not available in WCF solution). Then I was getting the […]

The post The HTTP request is unauthorized with client authentication scheme ‘Ntlm’. The authentication header received from the server was ‘NTLM’ appeared first on Binary Bits.

]]>
For one of the SharePoint implementation I was suppose to call the SharePoint 2010 ASMX service within a Custom WCF services hosted in a different server than the SharePoint 2010 host.

So as usual I added the service reference (PS: The add web reference is not available in WCF solution). Then I was getting the following error whenever the ASMX method was hit in the WCF.

"The HTTP request is unauthorized with client authentication scheme ‘Ntlm’. The authentication header received from the server was ‘NTLM’"

After breaking my head for few minutes, decided to hit the Google and got the solution in the source mentioned at the end.

So finally the code which worked is listed below.

 
  EndpointAddress endpoint = new EndpointAddress(new Uri("http://SharePointserver/_vti_bin/InvoiceServices.svc"));

  BasicHttpBinding httpBinding = new BasicHttpBinding();

  httpBinding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;

  httpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;

  InvoiceServicesClient myClient = new InvoiceServicesClient(httpBinding, endpoint);

  myClient.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;

  //Invoke the service method hereā€¦

Source: http://stackoverflow.com/questions/2608887/sharepoint-web-services-the-http-request-is-unauthorized-with-client-authenti

Note, in the above it might look like half of the link is missing and actually it works.

The post The HTTP request is unauthorized with client authentication scheme ‘Ntlm’. The authentication header received from the server was ‘NTLM’ appeared first on Binary Bits.

]]>
https://blog.binarybits.net/the-http-request-is-unauthorized-with-client-authentication-scheme-ntlm-the-authentication-header-received-from-the-server-was-ntlm/feed/ 0