使用 SAML 的 REST API 身份验证 [英] REST API authentication with SAML

查看:57
本文介绍了使用 SAML 的 REST API 身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力为使用网关的 REST API 设计 SAML2.0 身份验证.REST 用于我的后端和我的应用程序之间.我正在使用 Java Servlet 过滤器和 Spring.

I'm struggling to design a SAML2.0 authentication for a REST API using a gateway. REST is used between my backend and my application. I'm using Java Servlet filter and Spring.

我看到两种可能性:

  1. 每次都将 SAML 令牌添加到标头中.

  1. Adding the SAML tokens into the header each time.

使用 SAML 进行一次身份验证,然后在客户端和网关之间使用会话或类似(安全对话).

Authenticate once with SAML, then using a session or similar (secure conversation) between the client and the gateway.

案例 1: 这是一个很好的解决方案,因为我们仍然是 RESTful 但是:

Case 1: It's a good solution because we are still RESTful but:

  • SAML 令牌非常大.由于标头大小较大,可能会产生问题.
  • 重放令牌不是出于安全考虑的最佳方式.

案例 2:它不再是无状态的,我必须管理与客户端的链接.由于我使用网关,底层服务仍然可以是 RESTful.

Case 2: It's no more stateless and I have to managed a link with the client. Since I use a gateway, the underlying services can still be RESTful.

案例 2 寻找更好的选择,尽管它不遵循其余约束.

Case 2 looks for the better choice despite the fact that it does not follow the rest constraints.

是否有人已经这样做并给我一些指示(用于设计或实施)?

Is someone had already to do it and give me some pointers (for design or implementation)?

使用 SAML 有没有更好的方法来做到这一点?

Is there a better way to do it with SAML?

欢迎任何帮助或建议.

推荐答案

它仍然是草案,但是:OAuth2 SAML 承载配置文件可能是一个可能的解决方案.http://tools.ietf.org/html/draft-ietf-oauth-saml2-承载17

It is still draft, but: the OAuth2 SAML bearer profile may a possible solution. http://tools.ietf.org/html/draft-ietf-oauth-saml2-bearer-17

使用 SAML2 向 OAuth2 提供商进行身份验证,然后使用 OAuth2 令牌调用您的服务.

Use a SAML2 to authenticate to an OAuth2 provider, then call your service with the OAuth2 token.

这篇关于使用 SAML 的 REST API 身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆