How do I integrate laminas-mvc-middleware with API Tools

My problem statement is - I want to check if the Request has JWT token, if it has the token and the token is valid I want to pass the Request to the corresponding REST API. My plan is to use Laminas MVC Middleware for this purpose:
Client <—> Laminas Middleware <----> API Tools

Now my question is how do I integrate Middleware and API Tools in Laminas?

See: Quick Start - laminas-mvc-middleware - Laminas Docs

laminas-mvc does not have a global middleware pipe, so middleware can not be piped in front of MVC controllers.

A listener can help to check the token before a controller action is performed.

Please refer to this page: