Hi John,
Instead of adding a static call to each method, you can implement it
using a filter. For example, look at the
RolesAllowedResourceFilterFactory (
https://jersey.dev.java.net/nonav/apidocs/1.4-SNAPSHOT/jersey/index.html?com/sun/jersey/api/core/DefaultResourceConfig.html
) or the OAuthServerFilter (
https://jersey.dev.java.net/nonav/apidocs/1.4-SNAPSHOT/contribs/jersey-oauth/oauth-server/index.html
).
Martin
On Sep 8, 2010, at 8:14 PM, John Calcote wrote:
> Hi all -
>
> I'm working on a service that restricts all access to a single user,
> identified by x.509 certificate. Thus, authentication is certificate
> based, and authorization for that user must be done on each service
> endpoint within the service.
>
> What I'd like to hear is that there's an access point provided by
> jersey
> for authorizing any attempt to access a given service. Is this
> possible?
> If not, then my approach would be to add a static call to the top of
> each endpoint that potentially throws a WebApplicationException(401)
> if
> the user is unauthorized.
>
> Any advice would be much appreciated.
>
> Thanks in advance,
> John
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>