I have a Spring boot application with resteasy-spring-3.0.19 and jboss-jaxrs-api_2.0_spec-1.0.0.
I would like to intercept all the rest calls for authorization.
The interceptor is not getting invoked. Also, How can i get the target method @Path annotation value in the interceptor.
Do I need to register this in the Spring boot app?
@Provider
public class AuthorizationtInterceptor implements ContainerRequestFilter{
/**
*
*/
public AuthorizationtInterceptor() {
// TODO Auto-generated constructor stub
}
@Override
public void filter(ContainerRequestContext requestContext) throws IOException {
String method = requestContext.getMethod();
UriInfo uriInfo = requestContext.getUriInfo();
// Need the target method @Path annotation value ....
}
}
Target Rest class,
@Named
@Singleton
@Path(ROOT_PATH)
public class WebController {
@GET
@Path(TEST_PATH)
@Produces(MediaType.APPLICATION_JSON)
public Response getUser(@Context final HttpServletRequest request) {
}
}