I am trying to add authentication and authorization in my RESTEasy application.
This is my service method which I want to limit to users with 'admin' role:
@RolesAllowed("admin")
@PUT
@Path("/hosts/{id}")
@Produces("application/json")
public Response updateHost(@PathParam("id") int id) {
And this is my interceptor
@Provider
public class SecurityInterceptor implements javax.ws.rs.container.ContainerRequestFilter
{
@Override
public void filter(ContainerRequestContext requestContext)
{
However, my filter method does not get called and the authorization for updateHost is not done. After reading the docs, my understanding is @Provider on SecurityInterceptor will make sure that its filter method gets called after a request is received. Can anyone help me figure out why it is not being called?