hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gangwani, Jitesh (Churchill India)" <Jitesh.Gangw...@rbs.co.uk>
Subject RE: NTLM authentication problem
Date Thu, 16 Dec 2004 13:58:55 GMT
Still the same error message.

here is the code again after modifying.

****************************************************************************
***************************************************
 NTCredentials creds = new
NTCredentials("USERNAME","PASSWORD","10.222.86.21","MY_DOMAIN");
 HttpClient client = new HttpClient();
 HttpMethod method = new
GetMethod("http://www.maintenance.cws.pse1.rbsgrp.net/");
 AuthScope authscope =  new AuthScope("10.222.86.21",80);
 client.getState().setCredentials(authscope,creds);
 int statusCode = client.executeMethod(method);
 System.out.println("Status Code 1:  " + statusCode);
 String responseBody = method.getResponseBodyAsString();
 System.out.println("******" + responseBody);
 method.releaseConnection();
****************************************************************************
***************************************************


> -----Original Message-----
> From:	Michael Becke [SMTP:becke@u.washington.edu]
> Sent:	16 December 2004 13:31
> To:	HttpClient User Discussion
> Subject:	Re: NTLM authentication problem
> 
> *** WARNING : This message originates from the Internet ***
> 
> Also, be sure to use NTCredentials.
> 
> Mike
> 
> On Dec 16, 2004, at 7:41 AM, Gangwani, Jitesh (Churchill India) wrote:
> 
> > Hi Roland,
> > 	Thanks for looking into the problem.
> > The authentication scope in code is also
> > <http://www.maintenance.cws.pse1.rbsgrp.net:80>. I just removed if  
> > from code
> > for better understanding before sending the message.
> > Should I still try to set credentials as default.
> >
> > Thanks
> > Jitesh
> >
> >
> >
> >> -----Original Message-----
> >> From:	Roland Weber [SMTP:ROLWEBER@de.ibm.com]
> >> Sent:	16 December 2004 12:28
> >> To:	HttpClient User Discussion
> >> Subject:	Re: NTLM authentication problem
> >>
> >> *** WARNING : This message originates from the Internet ***
> >>
> >> Hello Jitesh,
> >>
> >> it looks like the authentication scope does not match:
> >>
> >> log: <http://www.maintenance.cws.pse1.rbsgrp.net:80>
> >> code: "http://servername/index.html"
> >>
> >> Try to set the credentials as default credentials, using
> >> null as the scope.
> >>
> >> hope that helps,
> >>   Roland
> >>
> >>
> >>
> >>
> >>
> >> "Gangwani, Jitesh (Churchill India)" <Jitesh.Gangwani@rbs.co.uk>
> >> 16.12.2004 13:05
> >> Please respond to
> >> "HttpClient User Discussion"
> >>
> >>
> >> To
> >> "'httpclient-user@jakarta.apache.org'"
> >> <httpclient-user@jakarta.apache.org>
> >> cc
> >>
> >> Subject
> >> NTLM authentication problem
> >>
> >>
> >>
> >>
> >>
> >>
> >> Hi,
> >>    I am trying to a get a webpage which is on IIS server in different
> >> domain secured by NTLM authentication. I am using
> >> commons-httpclient-3.0-beta1 api to connect. I am not able to get
> >> index.html page.
> >>
> >> The NLTM api is giving following information messages
> >>
> >> ********************************************************************** 
> >> ****
> >> **
> >> ********************
> >> 15-Dec-2004 16:01:46
> >> org.apache.commons.httpclient.auth.AuthChallengeProcessor
> >> selectAuthScheme
> >> INFO: ntlm authentication scheme selected
> >> 15-Dec-2004 16:01:46 org.apache.commons.httpclient.HttpMethodDirector
> >> processWWWAuthChallenge
> >> INFO: No credentials available for NTLM <any
> >> realm>@www.maintenance.cws.pse1.rbsgrp.net:80
> >> <http://www.maintenance.cws.pse1.rbsgrp.net:80>
> >> ********************************************************************** 
> >> ****
> >> **
> >> *********************
> >>
> >>
> >>
> >> The web page which is retrieved is of HTTP Error
> >> HTTP 401.2 - Unauthorized: Logon failed due to server configuration
> >> Internet Information Services
> >>
> >>
> >>
> >> Following is the java code
> >>
> >> ********************************************************************** 
> >> ****
> >> **
> >> *********************
> >>  NTCredentials creds =
> >> newNTCredentials("USERNAME","PASSWORD","SERVER_IP_ADDRESS","MY_DOMAIN" 
> >> );
> >>  HttpClient client = new HttpClient();
> >>  HttpMethod method = new GetMethod("http://servername/index.html");
> >>  AuthScope authscope =  new  
> >> AuthScope("http://servername/index.html",80);
> >>  client.getState().setCredentials(authscope,creds);
> >>  int statusCode = client.executeMethod(method);
> >>  System.out.println("Status Code 1:  " + statusCode);
> >>  String responseBody = method.getResponseBodyAsString();
> >>  System.out.println("******" + responseBody);
> >>  method.releaseConnection();
> >> ********************************************************************** 
> >> ****
> >> **
> >> ***********************
> >>
> >> Can anyone please tell me what I am doing wrong.
> >>
> >> Thanks
> >>
> >> Jitesh
> >>
> >>
> >>
> >>
> >> The Royal Bank of Scotland plc, Registered in Scotland No. 90312.
> >> Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
> >>
> >> The Royal Bank of Scotland plc is authorised and regulated by the
> >> Financial Services Authority and represents The Royal Bank of Scotland
> >> Marketing Group. The Bank sells life policies, collective investment
> >> schemes and pension products and advises only on the Marketing Group's
> >> range of these products and on a With-Profit Bond produced by Norwich
> >> Union Life (RBS) Limited.
> >>
> >> This e-mail message is confidential and for use by the addressee  
> >> only. If
> >> the message is received by anyone other than the addressee, please  
> >> return
> >> the message to the sender by replying to it and then delete the  
> >> message
> >> from your computer. Internet e-mails are not necessarily secure. The  
> >> Royal
> >>
> >> Bank of Scotland plc does not accept responsibility for changes made  
> >> to
> >> this message after it was sent.
> >>
> >> Whilst all reasonable care has been taken to avoid the transmission of
> >> viruses, it is the responsibility of the recipient to ensure that the
> >> onward transmission, opening or use of this message and any  
> >> attachments
> >> will not adversely affect its systems or data. No responsibility is
> >> accepted by The Royal Bank of Scotland plc in this regard and the
> >> recipient should carry out such virus and other checks as it considers
> >> appropriate.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail:  
> >> httpclient-user-help@jakarta.apache.org
> >>
> >>
> >
> >
> > The Royal Bank of Scotland plc, Registered in Scotland No. 90312.  
> > Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
> >
> > The Royal Bank of Scotland plc is authorised and regulated by the  
> > Financial Services Authority and represents The Royal Bank of Scotland  
> > Marketing Group. The Bank sells life policies, collective investment  
> > schemes and pension products and advises only on the Marketing Group's  
> > range of these products and on a With-Profit Bond produced by Norwich  
> > Union Life (RBS) Limited.
> >
> > This e-mail message is confidential and for use by the addressee only.  
> > If the message is received by anyone other than the addressee, please  
> > return the message to the sender by replying to it and then delete the  
> > message from your computer. Internet e-mails are not necessarily  
> > secure. The Royal Bank of Scotland plc does not accept responsibility  
> > for changes made to this message after it was sent.
> >
> > Whilst all reasonable care has been taken to avoid the transmission of  
> > viruses, it is the responsibility of the recipient to ensure that the  
> > onward transmission, opening or use of this message and any  
> > attachments will not adversely affect its systems or data. No  
> > responsibility is accepted by The Royal Bank of Scotland plc in this  
> > regard and the recipient should carry out such virus and other checks  
> > as it considers appropriate.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:  
> > httpclient-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


The Royal Bank of Scotland plc, Registered in Scotland No. 90312. Registered Office: 36 St
Andrew Square, Edinburgh EH2 2YB

The Royal Bank of Scotland plc is authorised and regulated by the Financial Services Authority
and represents The Royal Bank of Scotland Marketing Group. The Bank sells life policies, collective
investment schemes and pension products and advises only on the Marketing Group's range of
these products and on a With-Profit Bond produced by Norwich Union Life (RBS) Limited.

This e-mail message is confidential and for use by the addressee only. If the message is received
by anyone other than the addressee, please return the message to the sender by replying to
it and then delete the message from your computer. Internet e-mails are not necessarily secure.
The Royal Bank of Scotland plc does not accept responsibility for changes made to this message
after it was sent.

Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the
responsibility of the recipient to ensure that the onward transmission, opening or use of
this message and any attachments will not adversely affect its systems or data. No responsibility
is accepted by The Royal Bank of Scotland plc in this regard and the recipient should carry
out such virus and other checks as it considers appropriate.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message