cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SaravananRamamoorthy <saravanan.ramamoorth...@gmail.com>
Subject RE: Http basic authentication in JAX RS
Date Wed, 03 Feb 2010 15:18:13 GMT

Hi Sergey,


We tried to do Soap to Rest conversion.So we already have a  SOAP based
webservice and so the authentication and authorization is taken care of the
webservice.

The webservice need basic HTTP authentication.

We have created cxf client for the web service.

Now I need to pass the Authentication details from REST to SOAP.

The bottom line is that how JAX RS accepts HTTP basic authentication.

Once I get the Authentication details from the JAX RS , then I tried to add
the credentials in the SOAP Header.

Please provide your input and suggestions.





KARR, DAVID (ATTCINW) wrote:
> 
>> -----Original Message-----
>> From: SaravananRamamoorthy [mailto:saravanan.ramamoorthy.s@gmail.com]
>> Sent: Wednesday, February 03, 2010 6:54 AM
>> To: users@cxf.apache.org
>> Subject: Re: Http basic authentication in JAX RS
>> 
>> 
>> Hi Sergey,
>> 
>> 
>> I tried with your suggestions like
>> 
>> 	public Response getCredentials(@Context MessageContext mc)
>> 	{
>> 		AuthorizationPolicy policy =
>> (AuthorizationPolicy)mc.get(AuthorizationPolicy.class);
>>                 System.out.println(policy.getUserName());
>>                 .......
>>                 .......
>> When I tried to give the Authentication from SOAP UI, I got null.
>> 
>> 
>> Please correct me where I did the mistake.
> 
> Is the URL you tested defined in a "security-constraint" in your
> web.xml, along with specifying basic auth (as opposed to form)?  I think
> basic auth is only processed if it's specified in the web.xml that it's
> required.  Verify this by entering the wrong credentials and see if you
> get a 401 back.
> 
>> Sergey Beryozkin-2 wrote:
>> >
>> > Hi
>> >
>> > The only way at the moment to get AuthorizationPolicy object in the
>> app
>> > code is to do something like this :
>> >
>> > @Context MessageContext mc;
>> > ....
>> > AuthorizationPolicy policy =
>> > (AuthorizationPolicy)mc.get(AuthorizationPolicy.class);
>> >
>> > cheers, Sergey
>> >
>> >
>> >
>> >>
>> >> Hi All,
>> >>
>> >> I am creating REST application using JAX RS.
>> >>
>> >> I am using SOAPUI to test the application.
>> >>
>> >> My Rest needs to receive the Http Basic Authentication from the
>> >> SOAPUI.
>> >>
>> >> I just want to receive the authentication details like
>> >> username,password and
>> >> domain in JAX RS method.
>> >>
>> >> Can anyone give the idea how to get the authentication details in
>> the
>> >> parameter of the method.
>> >
>> > I ended up not needing this, but I experimented with creating an
>> > "AuthorizationRequestHandler" class (implements RequestHandler) and
>> > putting that in my "jaxrs:providers" list.  That requires a
>> > "handleRequest(Message message, ClassResourceInfo
> classResourceInfo)"
>> > method, where I can call "AuthorizationPolicy policy  =
>> > message.get(AuthorizationPolicy.class);".  The AuthorizationPolicy
>> > contains the username and password.
>> >
>> > What is not clear to me, however, is where this object is available
>> > somehow at the controller level.
>> >
>> >
>> >
>> 
>> --
>> View this message in context: http://old.nabble.com/Http-basic-
>> authentication-in-JAX-RS-tp27416364p27437539.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Http-basic-authentication-in-JAX-RS-tp27416364p27437937.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message