OAuth2小记
Oauth2分为四种认证方式,以微信公众号为例:
A、Authorization Code:通过授权码code进行认证,微信公众号采用此方法来获取code和网页授权access_token,特征为:response_type=code
手动授权:https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect
B、Implicit:Authorization Code 的简版形式,特征为:grant_type=authorization_code
获取用户信息:https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code
C、Resource Owner Password Credentials Grant :通过账号密码来进行认证,特征为:grant_type=password
D、Client Credentials Grant : 通过客户端来进行认证,微信公众号获取普通的基础access_token,特征为:grant_type=client_credentials
获取基础token: https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET
SSO
SSO:Single Sign On 单点登录即非同一域名下一处登录,其它系统均可登录。
SSO 传送门
CAS
CAS:Central Authentication Service 中央认证服务,实现SSO登录的框架
CAS 传送门
另外我最近发现Laravel-学员君,在用户认证与授权中有讲解,链接如下:
[https://xueyuanjun.com/books/laravel-tutorial](https://xueyuanjun.com/books/laravel-tutorial)
写作不易,如果您觉得对您有帮助,请您给我点个赞或者关注我 [送你小花花~]
网友评论