我在本地成功运行KeyCloak Gateway,为Kubernetes仪表板提供Google OIDC身份验证 . 但是,当应用程序部署为群集本身中的pod时,使用相同的设置会导致错误 .
网关在K8S pod中运行时看到的错误是:
unable to exchange code for access token {"error": "invalid_request: Credentials in post body and basic Authorization header do not match"}
我正在使用以下选项调用网关:
--enable-logging=true
--enable-self-signed-tls=true
--listen=:443
--upstream-url=https://mydashboard
--discovery-url=https://accounts.google.com
--client-id=<client id goes here>
--client-secret=<secret goes here>
--resources=uri=/*
将这些设置应用于pod中的容器后,我可以浏览到Gateway,重定向到Google以登录,然后重定向回到生成上述错误的Gateway .
什么可以解释在本地运行应用程序和在可能产生上述错误的pod中运行它之间的区别?
1 回答
最终结果是复制/粘贴失败,客户端密钥不正确 . 错误消息在这里没什么帮助,但至少它是一个简单的修复 .