nginxinc / kubernetes-ingress

NGINX and NGINX Plus Ingress Controllers for Kubernetes
https://docs.nginx.com/nginx-ingress-controller
Apache License 2.0
4.62k stars 1.96k forks source link

Introduce auth_request Policy support #4667

Open brianehlert opened 9 months ago

brianehlert commented 9 months ago

NGINX supports three different options in the authentication space:

The ingress controller currently supports JWT and OIDC through the Policy resource and we have received requests to support auth_request. This capability would support both the free and paid version of the project.

Also add customizing the 401 response: add error_page in the /api/ location (same place as the auth_request directive).

AC:

Questions to answer:

### Tasks
- [ ] Implementation on Virtual Server
- [ ] Implementation on Ingress

Aha! Link: https://nginx.aha.io/epics/NIC-E-124

jasonwilliams14 commented 5 months ago

I have been working on a prototype for auth_request, for both virtualserver and ingress resources.

It would be fairly straightforward to add a CRD policy to be applied to virtualserver and support the NGINX auth_request directives. This policy could be linked to http, server, or location, depending on the users requirement.

For ingress, we could create two additional annotations to support both directives needed for auth_request.

I will post a few prototypes for both applications in this thread.