是否可以在 Kubernetes Ingress 中同时配置 web 和 api 这两种类型的 AppId?

Is it possible to configure AppId in Kubernetes Ingress with both types web and api at the same time?

以便浏览器在未提供身份验证的情况下显示登录页面,但后端也会接受具有有效持有者令牌的调用。header。

这可能吗?如果可以,怎么做?

我们在入口后面的同一个命名空间中有几个 kubernetes 服务,并用

注释入口
ingress.bluemix.net/appid-auth: "bindSecret=binding-appidname namespace=somenamespace requestType=api serviceName=service-a"

requestType=web 也可以,但是 requestType=api,web 不起作用,添加注释两次也不会使用相应的请求类型。

AppId 文档 (https://console.bluemix.net/docs/services/appid/tutorial-kubernetes-auth.html) 在 "serviceName" 的描述中指出:To use multiple request types in the same cluster, configure an instance of App ID to use web and another to use api.,所以我觉得应该可以同时使用两者。

您可以使用 Ingress 注释保护同一命名空间中具有不同 requestType 的多个服务。语法是:

ingress.bluemix.net/appid-auth: "bindSecret=binding-appid-01 requestType=web serviceName=service1;bindSecret=binding-appid-01 requestType=api serviceName=service2;bindSecret=binding-appid-02 requestType=web serviceName=service3;"