授权链接为 api.xxxx.cm/oauth/authorization
grant_type:授权方式,可选值“password”和“refresh_token”,password表示使用账号密码获得授权(会返回access_token和refresh_token),refresh_token表示通过refresh_token获得授权(会返回access_token)
第一次访问grant_type=password&username=xxx&password=xxx
得到access_token和refresh_token
以后访问其他资源带上access_token
如果遇到access_token,就使用grant_type=refresh_token&refresh_token=xxx 来刷新access_token并返回access_token
改进:无痛自动刷新access_token
遇到access_token过期,后端自动刷新access_token,最后返回你要请求的资源和刷新后的access_token
来源:CSDN
作者:buyue__
链接:https://blog.csdn.net/buyueliuying/article/details/103751091