nokia / kong-oidc

OIDC plugin for Kong
Apache License 2.0
455 stars 320 forks source link

Apply plugin for all paths of the route #185

Open mikomeister opened 3 years ago

mikomeister commented 3 years ago

There is question-related to the plugin configuration. There is any possible use the nokia-oidc plugin for all path of the configured route? Imagine, that we have a gateway link like api-gateway.example.com/ and have few subpaths configured like another Kong routes - /service1, /service2 Can we configure plugin just on api-gateway.example.com/ and plugin will be applied for all other paths - service1, service2. For now, if I configure the plugin on gateway route it will be applied just for the gateway, api-gateway.example.com/service1 accessible without any auth, so i need do the same configuration for each of them.

ghunteranderson commented 3 years ago

Hello @mikomeister

I'm not sure if I fully understand your question yet. Are you asking how to add the plugin for all routes in the Kong instance? If so, there is an option to add the plugin globally. The readme gives an example here. With this approach, authentication will be required for all routes in that Kong instance. If you add new routes, authentication will automatically be required on them.

mikomeister commented 3 years ago

Hi @ghunteranderson , not actually, imagine that we have few already created Gateways like api-gw-prod, api-gw-dev. So when I tried to add route under a Gateway I need to configure the plugin on application route, in case if I have like 20 applications, I have to configure the plugin on each route, my question is - can I enable oidc plugin on the root gw route like api-gw-prod and other routes under this one will be inherite auth?)