users@grizzly.java.net

Re: Realm / Authentication & ServletContextListeners with grizzly servlet sebserver

From: RaphaelJ <raphael.jolivet_at_gmail.com>
Date: Tue, 8 Jun 2010 02:44:03 -0700 (PDT)

Oleksiy Stashok wrote:
>
> Can you pls. show the code, how you process this annotation under
> Tomcat? Or Jersey does it for you automatically?
>

Jersey does it automatically.
I just needed to register a filter:

<param-name>com.sun.jersey.spi.container.ResourceFilters</param-name>
<param-value>com.sun.jersey.api.container.filter.RolesAllowedResourceFilterFactory</param-value>
I did the same in the Grizzly initializer.

But, anyway, that was not the point :
The filter works great, it just needs an underlying authorization / realm
support :
Which Grizzly does not seem to provide by default.

I found this project:
http://securityfilter.sourceforge.net/
It implements a complete authentication / realm scheme in the form of a
standard JAX-RS filter.
So it can work on any container.

I have not tested it yet, but it seems to be exactly what I need.


Oleksiy Stashok wrote:
>
> Please use ServletAdapter constructor [1] and pass classname(s) of
> your ServletContextListener in the listeners parameter.
>

Ok, thanks, I did not notice this constructor.
This works fine.

Thanks gain for your quick and quality answer.
Regards,

Raphael
-- 
View this message in context: http://old.nabble.com/Realm---Authentication---ServletContextListeners-with-grizzly-servlet-sebserver-tp28768971p28815760.html
Sent from the Grizzly - Users mailing list archive at Nabble.com.