I'm trying to use this library (keycloak-connect) for authentication and authorization. It has a global middleware that can be directly used by app.use()
method or by wrapping a nestjs middlewareclass around it. But how to use the route specific express middleware which is used to protect individual routes?.
Example usage in plain express app
app.get( '/protected', keycloak.protect('adminRole'), handler );
The protect method returns a plain express middleware with signature function(req, res, next)