[Jersey] Re: forwarding from unprotected resource to protected resource without authentication

From: Pavel Bucek <>
Date: Tue, 14 Feb 2012 17:55:57 +0100


1) why would you want to do that? I presume that Resource method B is
protected for some reason and you don't really want to let unauthorized
users access it.

Anyway, you can create new client with appropriate credentials, call
method B, parse result and return it as a part of response to method A.
Or it can be even easier if these resources are in the same application,
you can share logic behind these (but then I don't see a reason why
method B should be protected).

2) don't mix jersey modules from different versions! I see jersey-server
1.9-ea04 and jersey-multipart 1.11-b04. This might cause lots of
hard-to-debug issues. You should use version 1.11 (latest stable).


On 2/14/12 3:05 PM, tmp wrote:
> Hello!
> I have 2 resources in my webapplication:
> Resource method A is accessible without authentication.
> Resource method B is protected (@RolesAllowed).
> When I call method B, I have to authenticate first.
> Is there a way to automatically authenticate a client within method A (so he
> doesn't have to authenticate manually) ?
> Here are my web& pom.xml:
> Thanks in advance
> --
> View this message in context:
> Sent from the Jersey mailing list archive at