OAuth 2客户端真的需要TLS吗?

时间:2011-12-04 21:17:39

标签: security oauth https oauth-2.0 ssl

我打算为现有应用构建一个委派的登录系统。我将实现OAuth客户端(在Web应用程序中)和OAuth服务器(一个简单的授权和资源服务器,现在真的只有'用户'资源。)

考虑到这一点,我在当前的OAuth 2 draft(第22版)中遇到了以下部分:

3.1.2.1.  Endpoint Request Confidentiality

   If a redirection request will result in the transmission of an
   authorization code or access token over an open network (between the
   resource owner's user-agent and the client), the client SHOULD
   require the use of a transport-layer security mechanism.

   Lack of transport-layer security can have a severe impact on the
   security of the client and the protected resources it is authorized
   to access.  The use of transport-layer security is particularly
   critical when the authorization process is used as a form of
   delegated end-user authentication by the client (e.g. third-party
   sign-in service).

这特别警告我,我应该在客户端上使用TLS。当然,我们在服务器上使用HTTPS,但是如果不是不可能的话,在所有客户端上启用HTTPS将很困难。

根据我对安全性的有限理解,我想有人可以窃取授权许可。这让我想到了我的问题:

不会进行客户端身份验证(使用客户端密钥)阻止窃听者使用授权授权吗?(因为恶意方不会知道客户端密钥,希望。)

如果没有,或者这里有另一个攻击向量,我没有看到,有什么办法可以让客户在没有HTTPS的情况下安全地工作吗?例如,OAuth 1会有帮助吗? (也许是因为它有额外的请求令牌步骤。)

P.S。:我计划使用TLS客户端证书进行客户端身份验证,而不是秘密,如果情况更好的话。

1 个答案:

答案 0 :(得分:2)

我认为你误解了这个警告的一部分。此OAuth警告正在解决OWASP A9违规问题。这就是说,即使您使用的是OAuth,您仍然需要一个安全的传输层来与客户端进行通信。客户端不需要密钥对进行身份验证,OAuth是客户端的身份验证形式。但是,浏览器仍使用存储为cookie值的会话ID对您的应用程序进行身份验证。担心的是,如果攻击者能够拦截此值,那么他将具有与受害客户端相同的访问权限。