kubernetes - 在 K8S 集群中使用 KeyCloak 网关
问题描述
我在本地成功运行 KeyCloak 网关,为 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 中的容器后,我可以浏览到网关,重定向到 Google 以登录,然后重定向回生成上述错误的网关。
什么可以解释在本地运行应用程序和在会产生上述错误的 pod 中运行它之间的差异?
解决方案
这最终证明是复制/粘贴失败,客户端密码不正确。错误消息在这里没有太大帮助,但至少它是一个简单的修复。
推荐阅读
- c - 在 C 中打印数组时,一些数字打印为 0.00
- javascript - 错误评估失败 - 试图将对象传递给 puppeteer 函数
- tensorflow - 与回归相比,使用 LSTM 进行时间序列预测有什么优势?
- java - 如何将 Maven 依赖项添加到 Azure Pipelines
- python - gensim 是如何快速找到最相似的单词的?
- c++ - 这段代码是在创建一个类对象吗?如果是这样,为什么要以这种方式使用它
- python - 如何获得按其他列分组的几列的总和?
- php - 未找到列:1054 未知列“字段列表”中的“taggables.tags_model_id”laravel 雄辩
- python - Tweepy 没有返回完整的推文:tweet_mode = 'extended' 不起作用
- python - 如何将一列连接到熊猫中不是无的现有列表列?