我可以使用 mTLS 代替 Open ID Connect 进行身份验证吗?

发布于 2025-01-13 07:13:37 字数 150 浏览 4 评论 0原文

我想使用 mTLS 来保护微服务,而不是 Open ID Connect。
据我了解,mTLS 的工作原理是,它通过 SSL 握手对两个服务之间的通信进行加密。

但是,我可以使用 mTLS 作为身份验证机制,而不是通过 Open ID Connect 保护服务吗?

I would like to use mTLS to protect microservices instead of Open ID Connect.
As I understand how mTLS works, it encrypts the communications between two services via SSL handshake.

However, can I use mTLS as authentication mechanism instead protect services through Open ID Connect?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若水般的淡然安静女子 2025-01-20 07:13:37

您可以使用 mTLS 作为微服务之间的基础设施安全解决方案,但它会有局限性,并且无法管理用户级别的安全。因此,这取决于您的微服务的客户端是谁,以及您需要如何授权 API 请求。

用户级别安全性

这是使用 OAuth 和 OIDC 的地方,通常有一个 Web 或移动应用程序作为客户端:

  • 客户端运行代码流并获取令牌
  • 客户端向微服务发送访问令牌
  • 微服务接收标识用户的 JWT 访问令牌
  • 微服务可以在需要时将其转发给其他微服务

由于访问令牌中的用户身份,API 可以执行用户级别的授权,例如。确保用户只能查看自己的购买历史记录。

结合 mTLS 和 OAUTH

将这两个构建块结合起来很常见,安全标准/法规有时也需要这样做。请参阅金融级安全概述了解一些示例场景。

You can use mTLS as an infrastructure security solution between microservices, but it will have limitations, and will not be able to manage user level security. So it depends who the clients of your microservices are, and how you need to authorize API requests.

USER LEVEL SECURITY

This is where OAuth and OIDC are used, and often there is a web or mobile app as a client:

  • The client runs a code flow and gets tokens
  • The client sends an access token to microservices
  • Microservices receive a JWT access token that identifies the user
  • Microservices can forward this to other microservices when required

Because of the user identity in the access token, the API can perform user level authorization, eg to. ensure that a user can only view their own purchase history.

COMBINING mTLS AND OAUTH

It is common to combine these two building blocks, and security standards / regulations sometimes require this. See this financial-grade security overview for some example scenarios.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文