spring-boot - Spring Boot、Minikube、Istio 和 Keycloak:“无效参数:redirect_uri”
问题描述
我有一个在 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 需要如何配置?
解决方案
推荐阅读
- java - Java Robot mouseMove 脚本未关闭
- c - 为什么在使用 wprintf 时 ©(版权符号)被替换为 (C)?
- angular - Cousera 上的 Ionic 和 Angular
- amp-ad - 如何将 amp-auto-ad 配置为使用宽度 100% 而不是 100vw
- php - Symfony 4 和 Amazon S3 - AWS 凭证不起作用
- css - 移动视图上的内容被截断(iphone x、ipad、ipad pro)
- linux - 如何使用 bash 将文件中每一行的前 2 个字母添加到列表中?
- rust - 如何导入substrate_primitives 以使用sr25519?
- python - Django QuerySet 查找返回多个对象
- android - libGDX 看不到 Android SDK