如果身份验证/授权在API Gateway级别(KONG),如何从.NET WebAPI中的请求中获取索赔?
我们拥有
- Identity服务器,该服务器生成JWT令牌以及基于用户名和密码的自定义索赔。
- 订单微服务带有端点“/订单”,该订单根据当前JWT令牌中的索赔返回订单列表。
- Kong Gateway处理所有请求,并根据配置转发到适当的服务。
- 我们已经在Kong中启用了JWT插件来授权请求(即验证身份服务器生成的JWT令牌)。
如果我们没有在启动类中写下与身份验证和授权有关的任何逻辑,则以微服务顺序获得索赔的最佳方法是什么?
We have
- Identity server which generates JWT tokens along with custom claims based on the username and password.
- Order microservice with the endpoint "/orders" which returns the list of orders based on the claims present in the present JWT token.
- Kong gateway to handle all the requests and forward to appropriate service based on configuration.
- We have enabled JWT plugin in Kong to authorized requests (i.e validate the JWT token generated by the Identity server).
What is the best way to get the claims in the Order microservice if we have not written any logic related to authentication and authorization in the Startup class?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论