在配置的 AKS 上,有一个带有使用 AAD 身份验证的应用程序的 docker 容器。
基于 this article还有配置的入口。 API 运行良好。
当我添加到带有 https 前缀的 Azure Active Directory 应用程序注册回复 URL 时,我收到错误“请求中指定的回复 URL 与为应用程序配置的回复 URL 不匹配”。我看到在浏览器地址行中,redirect_uri 以 http 开头。
当我添加以 http 开头的回复 URL 时,我收到“异常:关联失败”。
我尝试过的:添加到 ingress.yaml 设置 ingress.kubernetes.io/force-ssl-redirect: "true"
可能有某种方法可以强制 ingress 运行 https 而不是 http,或者可能有一些 AAD 重定向配置?有任何想法吗?
更新 2:http 重定向可能是因为 ADAL。
PS:能找到similar topic没有答案
更新3:
我决定不使用 nginx 作为入口。相反,我现在使用负载平衡器。很快就可以使用 Azure 应用程序网关入口 Controller
最佳答案
你试过这个吗?
By default the controller redirects HTTP clients to the HTTPS port 443 using a 308 Permanent Redirect response if TLS is enabled for that Ingress.
This can be disabled globally using
ssl-redirect: "false"
in the NGINX config map, or per-Ingress with thenginx.ingress.kubernetes.io/ssl-redirect: "false"
annotation in the particular resource.
更多信息 on the Ingress documentation link .
关于azure-active-directory - Kubernetes 和 AAD 身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51258599/