I'm in the middle of a project in which we're trying to implement authentication, how we want to achieve it is by an annotation (@Authenticated) to mark the endpoints that require authentication, the way we know is through Container Request Filter option available in Jersey framework.
It's pretty simple to achieve, below is the guide to achieve it.
https://dzone.com/articles/technique-to-shield-your-api-with-namebinding-1