oauth authorization api

一世执手 提交于 2020-01-28 04:50:45

授权链接为 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!