@contribute
2016-01-19T14:30:05.000000Z
字数 1166
阅读 1127
OAuth-2.0
OAuth(开放授权)是一个开放标准。允许第三方网站在用户授权的前提下访问在用户在服务商那里存储的各种信息。
在传统的c/s认证模型中,客户端对服务端请求有访问限制的资源时,需采用资源拥有者的凭证。为了给第三方应用提供限制资源的访问,资源拥有者必须分享凭证。这会导致一下问题:
1. 第三方应用必须存储资源拥有者的凭证,典型的就是密码。
2. 服务器必须支持密码认证,尽管这是很不安全的。
3. 第三方应用拥有存储资源拥有者的凭证后,对资源有全部的访问权限,资源拥有者如果要限制某个第三方应用的访问某个子资源或访问时间段,这是比较困难的。
4. 资源拥有者想撤销某个第三方应用而不影响其他应用也很麻烦。
5. Compromise of any third-party application results in compromise of
the end-user’s password and all of the data protected by that
password.
resource owner
资源所有者,本文中又称"用户"(user)。
An entity capable of granting access to a protected resource.
When the resource owner is a person, it is referred to as an
end-user.
resource server
资源服务器,即服务提供商存放用户生成的资源的服务器。它与认证服务器,可以是同一台服务器,也可以是不同的服务器。
The server hosting the protected resources, capable of accepting
and responding to protected resource requests using access tokens.
client
第三方应用。
An application making protected resource requests on behalf of the
resource owner and with its authorization. The term "client" does
not imply any particular implementation characteristics (e.g.,
whether the application executes on a server, a desktop, or other
devices).
authorization server
认证服务器,即服务提供商专门用来处理认证的服务器。
The server issuing access tokens to the client after successfully
authenticating the resource owner and obtaining authorization.