使用kong-jwt2header插件在上游获取索赔

发布于 2025-01-22 12:29:31 字数 468 浏览 0 评论 0原文

我已经在Kong中安装了 kong-jwt2header 插件,配置config.token_required = true

我还配置了Kong的身份服务,该服务用于生成JWT令牌。当我们设置config.token_required = true在kong-jwt2header插件中抛出一个错误{“ error”:“在请求jwt token”} nto offer {身份服务。

现在,我有两个选项

  1. 设置config.token_required = false
  2. 将身份服务保留在Kong Gateway之外。 因此,从身份服务请求令牌时,不需要JWT令牌。

从上面的两个方面,哪种是最好的方法?还是有更好的方法可以在上游发送索赔?

I have installed the kong-jwt2header plugin in the Kong with configuration config.token_required=true.

I also have configured the Identity service in kong which is used to generate the JWT token. As we set the config.token_required=true in kong-jwt2header plugin throws an error {"error": "No valid JWT token found"} while requesting a JWT token from the Identity service.

Now I have two options

  1. Set the config.token_required=false Or
  2. Keep the Identity service outside the Kong gateway.
    So that JWT token is not required while requesting a token from an identity service.

Which is the best way from the above two? Or are there any better ways we can send the claims upstream?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文