【发布时间】:2020-04-02 17:32:36
【问题描述】:
我有一个在 Minikube 中运行的应用程序,它可以与预期的入口网关一起使用。调用 Spring Boot 应用程序,显示视图并通过链接调用受保护的资源。调用将被转发到 Keycloak 并通过登录掩码进行授权,并按预期显示受保护的资源。
使用 Istio 重定向失败并显示消息:“无效参数:redirect_uri”。
我的 Istio 网关配置
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
namespace: istio-system
name: istio-bomc-app-gateway
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
我的虚拟服务配置
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: istio-bomc-app-hrm-virtualservice
namespace: bomc-app
spec:
hosts:
- "*"
gateways:
- istio-bomc-app-gateway.istio-system.svc.cluster.local
http:
- match:
- uri:
prefix: /bomc-hrm
route:
- destination:
host: bomc-hrm-service.bomc-app.svc.cluster.local
port:
number: 80
单击受保护的链接后,我在浏览器中得到以下 URI:
我看到 redirect_uri=http%3A%2F%2F192.168.99.100%2F 不完整。缺少 31380 端口。
Istio VirtualService 需要如何配置?
【问题讨论】:
标签: spring-boot keycloak minikube istio