https://blog.csdn.net/lixiang987654321/article/details/83381494html
OAuth 2.0定义了四种受权方式:mysql
一.密码模式(resource owner password credentials)(为遗留系统设计)(支持refresh token)web
二.受权码模式(authorization code)(正宗方式)(支持refresh token)spring
这种模式算是正宗的oauth2的受权模式sql
设计了auth code,经过这个code再获取token数据库
支持refresh token编程
请求地址:http://localhost:7010/uaa/oauth/authorize?response_type=code&client_id=wx_takeout_client_id&redirect_uri=http://localhost:7010/uaa/login后端
三.简化模式(implicit)(为web浏览器应用设计)(不支持refresh token)api
请求: 用浏览器(此时同受权码模式,浏览器能跳转到登陆页面,postman不行)浏览器
http://localhost:7010/uaa/oauth/authorize?response_type=token&client_id=wx_takeout_client_id&redirect_uri=http://localhost:7010/uaa/login
四.客户端模式(client credentials)(为后台api服务消费者设计)(不支持refresh token)
这种模式直接根据client的id和密钥便可获取token,无需用户参与
这种模式比较合适消费api的后端服务,好比拉取一组用户信息等
不支持refresh token,主要是没有必要
http://www.javashuo.com/article/p-aososazd-dp.html
http://www.javashuo.com/article/p-xplpvhnj-dx.html