Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 53974 invoked from network); 13 Jul 2007 21:19:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Jul 2007 21:19:20 -0000 Received: (qmail 90337 invoked by uid 500); 13 Jul 2007 21:19:13 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 90316 invoked by uid 500); 13 Jul 2007 21:19:13 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 90305 invoked by uid 99); 13 Jul 2007 21:19:13 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jul 2007 14:19:13 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [68.142.199.157] (HELO web81605.mail.mud.yahoo.com) (68.142.199.157) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 13 Jul 2007 14:19:09 -0700 Received: (qmail 60515 invoked by uid 60001); 13 Jul 2007 21:18:47 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=pacbell.net; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=dCc3HGoPhHdzKU7chA79V/nYfjquVDw/vtVzjr+M9rxaCKEekwBSOEHF6d4suXAKlLZvIdQ6sYshZjKpQe1ryl/PVGJz7bs0PzNw4TZWg4SZzSrM+38Fqc9PACGD3Es2khHomRlaOdkx/vtZD3TgpS49J3VydTVfdqJlcgyW2U8=; X-YMail-OSG: YUUtvSAVM1kGC_jJ6BwRWtvMlKcOwiOleq9N3W0xQWwO8mPxvUA47lgjM9zNvgBALgMUS_LhaLIXtFt2KuMiA9ePXtbj6cyQbq8xYCbXh1BNjVdttcU- Received: from [12.162.5.2] by web81605.mail.mud.yahoo.com via HTTP; Fri, 13 Jul 2007 14:18:47 PDT X-Mailer: YahooMailRC/651.38 YahooMailWebService/0.7.41.16 Date: Fri, 13 Jul 2007 14:18:47 -0700 (PDT) From: Shantanu Sen Subject: Re: Axis2 - how to set ServiceClient with http basic auth To: axis-user@ws.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Message-ID: <274880.60489.qm@web81605.mail.mud.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org I am using the following code but do not see any username/pw on the http request going out. Do I need to configure any transport related property? === ServiceClient axisClient = new ServiceClient(); HttpTransportProperties.Authenticator authenticator = (HttpTransportProperties.Authenticator)axisClient.getOptions().getProperty(HTTPConstants.AUTHENTICATE); if (authenticator == null ) { authenticator = new HttpTransportProperties.Authenticator(); axisClient.getOptions().setProperty( HTTPConstants.AUTHENTICATE, authenticator); } // commenting the following out does'nt help either. authenticator.setRealm(HttpTransportProperties.Authenticator.BASIC); authenticator.setUsername("test_user"); authenticator.setPassword("test_password"); === I see that in AbstractHTTPSender, the following code on lines 398 - 402 (Axis2-1.2.1 src) are getting executed with the correct username/pw that I supplied: --- AbstractHTTSender--- ... else { /*Credentials only for Digest and Basic Authentication*/ creds = new UsernamePasswordCredentials(username, password); agent.getState().setCredentials(new AuthScope(AuthScope.ANY), creds); } --- But when I look at the request using tcpmon I do not see the username/pw. I see other http specific parameters such as cookie etc correctly set. Any ideas? Thanks, Shantanu ----- Original Message ---- From: Dimuthu To: axis-user@ws.apache.org Sent: Wednesday, July 11, 2007 8:47:51 PM Subject: Re: Axis2 - how to set ServiceClient with http basic auth Hi, HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator(); String username = "user"; String passwd = "pass"; auth.setUsername(username); auth.setPassword(passwd); // un-comment the below line if you are sending authentication details // without receiving 401 Authentication Required //auth.setPreemptiveAuthentication(true); options.setProperty(HTTPConstants.AUTHENTICATE,auth); Regards, Dimuthu On Wed, 2007-07-11 at 16:49 -0700, Shantanu Sen wrote: > The article at http://wso2.org/library/161 seems obsolete.There is no HttpTransportProperties.BasicAuthentication in the current Axis2-1.2 codebase. Can this article be updated? > > Is the basic and ntlm authentication unified so that we just need to use HttpTransportProperties.Authenticator? > > Is the property name to be used HttpConstatns.AUTHENTICATE? > > Thanks for any help. > Shantanu Sen > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org > For additional commands, e-mail: axis-user-help@ws.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org For additional commands, e-mail: axis-user-help@ws.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org For additional commands, e-mail: axis-user-help@ws.apache.org