Hello together,
I have registered multiple resources on the Authorization Server, which are named as Process_{id}, where {id} is a random uuid.
When using the policy enforcer middleware in the Keycloak-Connect Node.js library, I would protect my route as follows:
app.get(’/processes/:id’, keycloak.enforcer(’{name of resource}:view’), handler) where {name of resource} is the name of the resource that is registered at the Authorization Server, for example Process_5e2d1aca-6c39-4719-b2a5-5f55dada9ea0.
So far, I have only seen examples, where {name of resource} is hardcoded. How would you implement this with a dynamic resource name based on the query string, that identifies the process that is requested?