Whether variable parameters can be added to generic middleware?

When using 'ForwardAuth' middleware, I want to pass APP_ID and APP_SECRET in the Auth route for different clients. If the reuse 'ForwardAuth' can only pass a fixed set, this cannot be done. I would like to ask if there is a way to replace param in Auth route by passing in parameters when using middleware