> -----Original Message----- > From: SaravananRamamoorthy [mailto:[email protected]] > Sent: Monday, February 01, 2010 11:25 PM > To: [email protected] > Subject: Http basic authentication in JAX RS > > > 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.
