users@jersey.java.net

[Jersey] Re: How to make authenticated request to a jersey endpoint protected using spring-security

From: Jakub Podlesak <jakub.podlesak_at_oracle.com>
Date: Tue, 01 Nov 2011 23:27:08 +0100

Hi Farrukh,

As a quick workaround, you can probably switch to using HTTP basic
authentication (Spring security should allow you to do that) for testing
purposes.
Then you can utilize Jersey's HTTPBasicAuthFilter [1] in your tests on
the client side.

If the form based login establishes some Servlet session backed
authentication
mechanism, it is IMHO anyway not suitable for a REST interface, and you
should
probably look for another authentication method even for your production
environment.
But this is based on my assumptions only, i do not know, if sessions are
used or not.

~Jakub

P.S. Btw: Have you had a chance to look at Jersey's OAuth support?

[1]http://jersey.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/client/filter/HTTPBasicAuthFilter.html


On 29.10.2011 19:17, Farrukh Najmi wrote:
> Hi Guys,
>
> This is more of a spring question so I have posted it in spring forum:
>
> http://forum.springsource.org/showthread.php?116506-How-to-test-authenticated-access-to-endpoint-secured-with-spring-security&p=385173#post385173
>
>
> If any one has the answer in the jersey community please share. Thank
> you.
>