简体   繁体   中英

Kubernetes - Ingress - Nginx : Forward query parameters from original request to auth-url

Is there a way to forward query parameters from original request to auth-url? I know we have X-Original-URL but can we directly get them as query parameter for auth-url?

Ingress controller cuts off url query parameters from the original request when calling external authorization endpoint.
This is an issue in OAuth scenario when the OAuth server sends the authorization code back to the resource server.
The auth enpoint needs that code to get access token.

Try to use the image quay.io/aledbf/nginx-ingress-controller:0.185 it uses the rd parameter for the correct redirect url after the login.

You can also add State Parameter . It will help for oauth2_proxy .

State parameter will reserve the state prior to authentication request and pass random generated state value in request to authenticate and in call back request they will add state back ie Oauth2_Proxy generated id. Then Oauth2_Proxy will read that ID and provide the URL back and respond.

Take a look: ingress-nginx-issue , configuring-http-basic-authentication/ , url-to-oauth-proxy-as-redirect .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM