登录授权整理(OAuth)

The OAuth 2.0 authorization framework enables a third-party application to obtain limited access to an HTTP service, either on behalf of a resource owner by orchestrating an approval interaction between the resource owner and the HTTP service, or by allowing the third-party application to obtain access on its own behalf. This specification replaces and obsoletes the OAuth 1.0 protocol described in RFC 5849.

一、基本脑图

登录授权整理(OAuth)_第1张图片

二、四种方式流程图

1. 授权码

登录授权整理(OAuth)_第2张图片

2. 隐藏式

登录授权整理(OAuth)_第3张图片

3. 密码式

登录授权整理(OAuth)_第4张图片

4. 客户端凭证登录授权整理(OAuth)_第5张图片

三、令牌更新

验证通过后会返回两个令牌

1、获取数据的令牌
2、获取新令牌的令牌(refresh_token)

使用refresh_token获取新的令牌。

参考资料

  • OAuth 2.0 RFC 文档
  • 理解OAuth 2.0(阮一峰的网络日志)
  • OAuth 2.0的一个简单解释(阮一峰的网络日志)
  • OAuth 2.0 的四种方式(阮一峰的网络日志)
  • GitHub OAuth第三方登录示例教程(阮一峰的网络日志)
  • Wikipedia OAuth
  • 理解OAuth 2
  • 聊聊授权登录的那些事

你可能感兴趣的:(前端,web,OAuth,认证)