Please try using Jersey's ContainerRequestFilters interface. Write a class implementing this interface. Override the method
public ContainerRequest filter(ContainerRequest request).
ContainerRequest will provide you with all the references to get the Authorization header of the client request, which contains the request credentials. Use your custom auth module from here.
Add the above filter to your
servlet definition in web.xml.
This will definitely help you to achieve your functionality.
Let me know if needed sample code snippet for this.
Thanks,
Kesava.