Token based authentication using nginx-ingress annotations

10/26/2021

I am trying to pass token as query parameter to ingress annotation auth-url to perform token validation. I need to extract token from URL similar to one mentioned below:

https://xx.xx.xx.xx/red/openapi/test?token=12643AF7C4CF4DA4960AB23157405C40 note: I cannot use Oauth2 to implement this use case.

I need help to identify which annotation can be used to extract token from uri and pass it to variable $token

apiVersion: extensions/v1beta1 kind: Ingress metadata: annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/auth-response-headers: authorization nginx.ingress.kubernetes.io/auth-url: http://authorization-v2.<namespace>.svc.cluster.local:8080/authorization-v2/api/v1/validate?token=$token

-- Khayal Ghosh
kubernetes
nginx-ingress

0 Answers