【问题标题】:Spring Boot, Minikube, Istio and Keycloak: "Invalid parameter: redirect_uri"Spring Boot、Minikube、Istio 和 Keycloak:“无效参数:redirect_uri”
【发布时间】: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:

http://192.168.99.100:31380/auth/realms/bomc-hrm-realm/protocol/openid-connect/auth?response_type=code&client_id=bomc-hrm-app&redirect_uri=http%3A%2F%2F192.168.99.100%2Fbomc-hrm%2Fui%2Fcustomer%2Fcustomers&state=4739ab56-a8f3-4f78-bd29-c05e7ea7cdbe&login=true&scope=openid

我看到 redirect_uri=http%3A%2F%2F192.168.99.100%2F 不完整。缺少 31380 端口。

Istio VirtualService 需要如何配置?

【问题讨论】:

    标签: spring-boot keycloak minikube istio


    【解决方案1】:

    您是否已将以下命令签入 Google Cloud 也许你会有使用它的线索

    kubectl 描述

    Check Kube

    【讨论】:

      猜你喜欢
      • 2018-01-03
      • 2021-11-16
      • 2021-10-27
      • 2018-01-03
      • 2022-08-24
      • 2019-05-03
      • 2019-06-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多