What servlet-filter coding is necessary to map REST calls to external Basic Authenticated user accounts?

What servlet-filter coding is necessary to map REST calls to external Basic Authenticated user accounts that are making REST API calls?
Details:
We must be able to id external users and stop all but a list of them from using Jira Server API.
I understand the jira app uses the API extensively and that we do NOT want to interrupt these.
All our external users are within MS Active Directory and our Jira single server instance does NOT allow anonymous login.

Thank you very much for your time and expertise,
Craig