List Info

Thread: Need NTLM Authentication help




Need NTLM Authentication help
country flaguser name
United States
2008-06-11 08:59:42
I am trying to connect to a web service using Axis2 version
1.4 (Latest
one available for download from the site) and Java version
1.4.2

I can reach the web service but I keep failing to
authenticate, as I do
not really know how to properly authenticate using NTLM.

I am getting the following error attempting to connect:

Transport error: 401 Error: Unauthorized
org.apache.axis2.AxisFault: Transport error: 401 Error:
Unauthorized

There was some code online describing how you can create an
instance of
HttpTransportProperties.NTLMAuthentication however that
subclass
"NTLMAuthentication" does not exist anywhere in
the Apache Axis2 JAR and
my compiler gets an error on that line. I have no idea what
version they
were using but it is certainly not the latest one.

Here's the code I have now to reach the web service:

TestStub stub = new TestStub();
Options options = stub._getServiceClient().getOptions();

HttpTransportProperties.ProxyProperties proxy = new
HttpTransportProperties.ProxyProperties();
proxy.setProxyPort(80);
proxy.setDomain("someproxy.somedomain.com");		 
proxy.setProxyName("someproxy.somedomain.com");
options.setProperty(org.apache.axis2.transport.http.HTTPCons
tants.PROXY,
proxy);
		  
TestStub.GetTestResponse resp = stub.GetTest(new
TestStub.GetTest());
		 
What do I need to change here to properly use NTLM
authentication? 


------------------------------------------------------------
---------
To unsubscribe, e-mail: axis-dev-unsubscribews.apache.org
For additional commands, e-mail: axis-dev-helpws.apache.org


Re: Need NTLM Authentication help
user name
2008-06-12 01:47:36
Please use the following code

HttpTransportProperties.Authenticator ntlmAuthentication =
       ;           ;  new HttpTransportProperties.Authenticator();

    ;        ntlmAuthentication.setUsername("axis2");
    ;        ntlmAuthentication.setPassword("axis2");
        ;    ntlmAuthentication.setHost(";axis2";);
     ;       ntlmAuthentication.setPort(9443);
         ;   ntlmAuthentication.setRealm("someRealm");
ntlmAuthentication.setAllowedRetry(boolean allowedRetry)

   ;         options.setProperty(
org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
   ;           ;      ntlmAuthentication);

On Wed, Jun 11, 2008 at 7:29 PM, Lozina, Tony < tony.lozina1pbsg.com">tony.lozina1pbsg.com&gt; wrote:
I am trying to connect to a web service using Axis2 version 1.4 (Latest
one available for download from the site) and Java version 1.4.2

I can reach the web service but I keep failing to authenticate, as I do
not really know how to properly authenticate using NTLM.

I am getting the following error attempting to connect:

Transport error: 401 Error: Unauthorized
org.apache.axis2.AxisFault: Transport error: 401 Error: Unauthorized

There was some code online describing how you can create an instance of
HttpTransportProperties.NTLMAuthentication however that subclass
"NTLMAuthentication" does not exist anywhere in the Apache Axis2 JAR and
my compiler gets an error on that line. I have no idea what version they
were using but it is certainly not the latest one.

Here's the code I have now to reach the web service:

TestStub stub = new TestStub();
Options options = stub._getServiceClient().getOptions();

HttpTransportProperties.ProxyProperties proxy = new
HttpTransportProperties.ProxyProperties();
proxy.setProxyPort(80);
proxy.setDomain(";someproxy.somedomain.com");
proxy.setProxyName("someproxy.somedomain.com");
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.PROXY,
proxy);

TestStub.GetTestResponse resp = stub.GetTest(new TestStub.GetTest());

What do I need to change here to properly use NTLM authentication?


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribews.apache.org">axis-dev-unsubscribews.apache.org
For additional commands, e-mail: axis-dev-helpws.apache.org">axis-dev-helpws.apache.org




--
Saminda Abeyruwan

Senior Software Engineer
WSO2 Inc. - www.wso2.org
Re: Need NTLM Authentication help
user name
2008-06-12 01:48:24
HttpTransportProperties.Authenticator ntlmAuthentication =
 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp; new HttpTransportProperties.Authenticator();

 &nbsp; &nbsp; &nbsp; &nbsp;   ; ntlmAuthentication.setUsername(&quot;axis2&quot;);
&nbsp;   ; &nbsp; &nbsp; &nbsp;  ntlmAuthentication.setPassword(&quot;axis2&quot;);
&nbsp; &nbsp; &nbsp;   ; &nbsp;  ntlmAuthentication.setHost(";axis2";);
 &nbsp;   ; &nbsp; &nbsp; &nbsp; ntlmAuthentication.setPort(9443);
 &nbsp; &nbsp; &nbsp;   ; &nbsp; ntlmAuthentication.setRealm(&quot;someRealm");
  ; &nbsp; &nbsp; &nbsp; &nbsp; ntlmAuthentication.setAllowedRetry(true)

&nbsp;   ; &nbsp; &nbsp; &nbsp;  options.setProperty(
org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;  ntlmAuthentication);


On Thu, Jun 12, 2008 at 12:17 PM, Saminda Abeyruwan < samindaagmail.com">samindaagmail.com> wrote:
Please use the following code

HttpTransportProperties.Authenticator ntlmAuthentication =
 &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ;  new HttpTransportProperties.Authenticator();

&nbsp;   ; &nbsp; &nbsp; &nbsp;  ntlmAuthentication.setUsername(&quot;axis2&quot;);
 &nbsp; &nbsp; &nbsp; &nbsp;   ; ntlmAuthentication.setPassword(&quot;axis2&quot;);
&nbsp; &nbsp; &nbsp;   ; &nbsp;  ntlmAuthentication.setHost(";axis2";);
 &nbsp;   ; &nbsp; &nbsp; &nbsp; ntlmAuthentication.setPort(9443);
 &nbsp; &nbsp; &nbsp;   ; &nbsp; ntlmAuthentication.setRealm(&quot;someRealm");
ntlmAuthentication.setAllowedRetry(boolean allowedRetry)

   ; &nbsp; &nbsp; &nbsp; &nbsp; options.setProperty(
org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;  ntlmAuthentication);


On Wed, Jun 11, 2008 at 7:29 PM, Lozina, Tony < tony.lozina1pbsg.com" target="_blank">tony.lozina1pbsg.com&gt; wrote:
I am trying to connect to a web service using Axis2 version 1.4 (Latest
one available for download from the site) and Java version 1.4.2

I can reach the web service but I keep failing to authenticate, as I do
not really know how to properly authenticate using NTLM.

I am getting the following error attempting to connect:

Transport error: 401 Error: Unauthorized
org.apache.axis2.AxisFault: Transport error: 401 Error: Unauthorized

There was some code online describing how you can create an instance of
HttpTransportProperties.NTLMAuthentication however that subclass
"NTLMAuthentication" does not exist anywhere in the Apache Axis2 JAR and
my compiler gets an error on that line. I have no idea what version they
were using but it is certainly not the latest one.

Here's the code I have now to reach the web service:

TestStub stub = new TestStub();
Options options = stub._getServiceClient().getOptions();

HttpTransportProperties.ProxyProperties proxy = new
HttpTransportProperties.ProxyProperties();
proxy.setProxyPort(80);
proxy.setDomain(";someproxy.somedomain.com");
proxy.setProxyName("someproxy.somedomain.com");
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.PROXY,
proxy);

TestStub.GetTestResponse resp = stub.GetTest(new TestStub.GetTest());

What do I need to change here to properly use NTLM authentication?


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribews.apache.org" target="_blank">axis-dev-unsubscribews.apache.org
For additional commands, e-mail: axis-dev-helpws.apache.org" target="_blank">axis-dev-helpws.apache.org




--
Saminda Abeyruwan

Senior Software Engineer
WSO2 Inc. - www.wso2.org



--
Saminda Abeyruwan

Senior Software Engineer
WSO2 Inc. - www.wso2.org
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )