JWT Servlet filter for REST API

Hello everyone, can someone please guide me on the feasibility of creating a Servlet filter for the REST API?
Is there any documentation to guide one on extending the authentication in Jira? i.e. servlet filter etc.

Graham