<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Web Service authentication with NTLM</title><link>https://answers.axonivy.com/questions/415/web-service-authentication-with-ntlm</link><description>&lt;p&gt;We should call an internal web service but we always get the error message &lt;code&gt;Transport error: 401 Error: Unauthorized&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We try to authenticate with NTLM and we have the suspicion that we made wrong configuration settings. How can we configure Ivy to work with NTLM based web services?&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/415/web-service-authentication-with-ntlm" rel="self"></atom:link><language>en</language><lastBuildDate>Wed, 17 Aug 2011 11:38:52 -0400</lastBuildDate><item><title>Answer by Tamas KIS</title><link>https://answers.axonivy.com/questions/415/web-service-authentication-with-ntlm/416</link><description>&lt;p&gt;Xpert.ivy supports NTLM authentication for web services exclusively with Axis 2 which uses the good old HTTPClient library. Unfortunately this library does not support all NTLM versions. &lt;/p&gt;
&lt;p&gt;Use something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import org.apache.axis2.transport.http.HttpTransportProperties;
import org.apache.axis2.transport.http.HTTPConstants;

HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
auth.setDomain( "yourDomain" );
auth.setHost( "einHost" );
authSchemes.add(HttpTransportProperties.Authenticator.NTLM);
auth.setAuthSchemes(authSchemes)
auth.setPreemptiveAuthentication(true); // send authentication info at once
axisClientOptions.setProperty(HTTPConstants.AUTHENTICATE, auth);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This code work with some Sharepoint services and NTLM. If you need to know more about authentication with NTLM and Axis please refer to internet resources.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tamas KIS</dc:creator><pubDate>Wed, 17 Aug 2011 11:38:52 -0400</pubDate><guid>https://answers.axonivy.com/questions/415/web-service-authentication-with-ntlm/416</guid></item></channel></rss>