docker-compose - cookie 设置为安全,但您的重定向 url 在 keycloak-gatekeeper 中是非 tls 错误
问题描述
[error] the cookie is set to secure but your redirection url is non-tls
在我的 keycloak-gatekeeper 容器中面临这个问题
在我的 .conf 文件下面
discovery-url: http://localhost:8180/auth/realms/employee-ms/keys
skip-openid-provider-tls-verify: true
client-id: employee-admin
client-secret:
listen: :3000
enable-refresh-tokens: true
tls-cert:
tls-private-key:
redirection-url: http://localhost:8084/*
encryption-key: vGcLt8ZUdPX5fXhtLZaPHZkGWHZrT6aa
upstream-url: http://employee:80/
scopes:
resources:
- uri: /*
methods:
- GET
- uri: /admin/*
methods:
- GET
roles:
- openvpn:vpn-user
- openvpn:prod-vpn
- uri: /admin/*
methods:
- GET
roles:
- openvpn:vpn-user
- openvpn:commons-prod-vpn
解决方案
错误中包含所有内容:the cookie is set to secure but your redirection url is non-tls
(http 协议是非 tls 协议,因此您需要 https 协议)。
有默认值secure-cookie: true
,与您的配置不兼容redirection-url: http://localhost:8084/*
。
您有 2 个选项:
1.) 为您的应用配置 TLS,然后您就可以拥有redirection-url: https://localhost:8084/*
2.) 禁用安全 cookiesecure-cookie: false
选项 1 更好更安全,因为 OIDC 协议需要 TLS(您应该也为 Keycloak 设置 TLS)。
推荐阅读
- weblogic - 当我尝试启动集成 Web 逻辑服务器时,WebLogic 服务器在 Jdeveloper 12.2.1.4 中处于运行阶段
- c++ - 我使用 send() 但 select() 在 writefds 中被阻塞
- java - 我可以拥有一个 Avro 架构,其中的枚举包含值作为枚举成员吗?
- javascript - Onclick在React js中关闭模式
- php - Spatie Laravel 权限编码问题
- angular-cli - 复制资产作为 Angular 9 库构建的一部分
- python - Networkx Kernighan-Lin 多分区
- javascript - vue-pdf 无法加载到所有页面“未定义的属性”
- cordova - 如何在科尔多瓦应用程序中包含 git 描述信息
- python - 如何从这样的目录结构中正确导入类?