TeslaGov / ngx-http-auth-jwt-module

Secure your NGINX locations with JWT
MIT License
308 stars 118 forks source link

Example for common usage with ingress-nginx #93

Open rufreakde opened 1 year ago

rufreakde commented 1 year ago

Hi, since this module is solving an crucial gap specifically for the nginx community I was thinking it might make sense to add a simplistic example configuration somewhere how to configure it open source kubernetes community projects like for example https://github.com/kubernetes/ingress-nginx

Maybe with snippet:

nginx.ingress.kubernetes.io/configuration-snippet: |

or: https://kubernetes.github.io/ingress-nginx/examples/customization/custom-configuration/ or differently?

I am a total beginner here.

If I would try to configure INGRESS-NGINX today I would be kind of lost how to start.

My IDP exposes

"jwks_uri": "https://<IDP>/oauth2/certs",

uri content:

{
  "keys": [
    {
      "kty": "RSA",
      "x5t#S256": "xxxxxx",
      "e": "AQAB",
      "use": "sig",
      "kid": "xxxxxxx",
      "x5c": [
        "xxxxxxxxxxxxxx"
      ],
      "alg": "RS256",
      "n": "xxxxxxxxxxxxxx"
    }
  ]
}
JoshMcCullough commented 1 year ago

Hi. I think you're right, it would make sense to add a few config examples, and one using Kubernetes-NGINX-ingress seems reasonable. Thanks for the request, we'll try to get to it unless someone else is kind enough to provide one.