axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew B <vidal_buff...@yahoo.com>
Subject Re: [Axis2]getting username and password
Date Thu, 22 Jun 2006 15:00:13 GMT
Davanum,

I set the username and password on the SOAPBindingStub on the client side (with Axis 1) like
this:

clientStub.setUsername( .... );

I thought this was HTTP Basic authentication. But, when I do the following, per your suggestion:

        HttpServletRequest request = (HttpServletRequest)incomingContext.getProperty(Constants.HTTP_SERVLET_REQUEST);
   
        String auth = (String) request.getHeader(HTTPConstants.HEADER_AUTHORIZATION);

the string I get back is:

Basic V0FMTUFSVDpXQUwxMjNNQVJU

which does not contain the username and password. Either I am  doing something wrong, or clientStub.setUsername()
is not HTTP Basic authentication.

Thanks,

Andrew


Davanum Srinivas <davanum@gmail.com> wrote: Andrew,

Are u talking about HTTP Basic authentication? You can access the
HttpServletRequest as follows:

HttpServletRequest request = (HttpServletRequest)
msgContext.getProperty(Constants.HTTP_SERVLET_REQUEST)

Then use:
String auth = (String) request.getHeader(HTTPConstants.HEADER_AUTHORIZATION)

to get the http header for authorization. You can then parse out the
user id and password as shown here [1]

-- dims

[1] http://koders.com/java/fidDCB769581B5FB55A16B0B191DEB229F79B8CB9E2.aspx

On 6/21/06, Andrew B  wrote:
> Hi,
>
> Does anyone know how to get the username and password that were set on the
> client stub, in the service implementation class? This is another thing that
> was easy in Axis 1 but so far seems to be impossible in Axis 2. I need them
> to do authentication.
>
> Thanks,
>
> Andrew B
>
>
>  ________________________________
> Want to be your own boss? Learn how on Yahoo! Small Business.
>
>


-- 
Davanum Srinivas : http://people.apache.org/~dims/

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



 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
Mime
View raw message