如何将标题传递到nginx Ingress中的auth-url
通过auth-url中的Auth-url中的Auth标题的正确方法是什么?以下是我当前的NGINX INGRESS配置:
nginx.ingress.kubernetes.io/auth-cache-key: $remote_user$http_authorization
nginx.ingress.kubernetes.io/auth-response-headers: Authorization
nginx.ingress.kubernetes.io/auth-signin: mydomain/signin
nginx.ingress.kubernetes.io/auth-url: mydomain/check
流量将首先转到 /签名,在我的外部Oauth Signin之后,它将转到我发送授权标头的另一个 /重定向端点,然后将其重定向回原始URL。但是下次流量转到原始URL并命中 /检查时,它不会将授权标头传递给我 /检查端点,以使其再次失败。我以为nginx.ingress.kubernetes.io/auth-response-headers会为我传递标题,但行不通。在我的情况下,你知道如何通过标头吗?
非常感谢!
What is the correct way to pass auth header in auth-url for external auth? Below is my current nginx ingress config:
nginx.ingress.kubernetes.io/auth-cache-key: $remote_user$http_authorization
nginx.ingress.kubernetes.io/auth-response-headers: Authorization
nginx.ingress.kubernetes.io/auth-signin: mydomain/signin
nginx.ingress.kubernetes.io/auth-url: mydomain/check
Traffic will first go to /signin, and after my external oauth signin, it will go to my another /redirect endpoint where I send Authorization header, and redirect back to the original url. But next time when traffic goes to original url and hits /check, it does not pass Authorization header to my /check endpoint so it fails the auth verification again. I thought nginx.ingress.kubernetes.io/auth-response-headers would pass the header for me but it did not work. Do you know how to pass header in my case?
Many thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过专门设置
auth-snippet
注释中的标头?Have you tried setting specifically the header inside the
auth-snippet
annotation?