kubernetes-ingress icon indicating copy to clipboard operation
kubernetes-ingress copied to clipboard

OIDC: option to pass access token as authorization header to upstream

Open suedschwede opened this issue 3 years ago • 3 comments

I would like to configure OIDC in NGINX and pass the access token as authorization header to a backend application At the moment it is only possible to pass jwt claims

suedschwede avatar Apr 27 '22 07:04 suedschwede

Hi @suedschwede thanks for reporting!

Be sure to check out the docs while you wait for a human to take a look at this :slightly_smiling_face:

Cheers!

github-actions[bot] avatar Apr 27 '22 07:04 github-actions[bot]

Hi @suedschwede

we use https://github.com/nginxinc/nginx-openid-connect under the hood. I would suggest opening an issue there.

lucacome avatar May 06 '22 15:05 lucacome

I have the same issue. This is a blocker for using Nginx Ingress controller.

My case is slightly different. I need to pass the ID token to upstream. This is already supported in nginx-openid-connect.

I tried to add $session_jwt to a header through policies, but are denied as there is a whitelist at pkg/apis/validation/virtualserver.go:1094 (on the v2.2.2 tag).

Username is also hard coded in the template (nginx-plus.virtualserver.tmpl:363).

I´m able to add a workaround if I patch the code, but I would rather not.

In the longer run, I assume we also need to pass access token to upstream. Exposing tokens to upstream is a functionality most other similar software has, and this is a blocker for using Nginx Plus now.

nixx avatar Aug 11 '22 08:08 nixx