[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发布于 2021-10-02 06:25:35
错误中包含了所有内容:the cookie is set to secure but your redirection url is non-tls (http协议是非tls协议,因此您需要在那里使用https协议)。
存在与您的配置redirection-url: http://localhost:8084/*不兼容的默认值secure-cookie: true。
您有两个选项:
1.)为您的应用程序配置TLS,然后即可使用redirection-url: https://localhost:8084/*
2.)禁用安全cookie secure-cookie: false
选项1更好、更安全,因为OIDC协议需要TLS (您还应该为Keycloak使用TLS )。
https://stackoverflow.com/questions/69400683
复制相似问题