Skip to content

刷新 token 接口 ​

接口说明

刷新 token

请求参数

请求服务:智数通服务地址 http 端口

请求方式:GET

请求路径:/oauth2/refresh

请求示例

http://zhishutong.dev.idx.space/auth/oauth2/token?grant_type=refresh_token&client_id=7a6e7bcd7fa14c8d8e8fc9d1ddc9c81f&client_secret=58e76bcf2baf4fbe82c00308b4cb0f36&refresh_token=pICFPHKSsvFP7ZVQKSw9UtHvN0EajndbE5p9q5Qs6dKUru80zEFsrMMyystk

说明:http://zhishutong.dev.idx.space/auth为3.3.1中返回的oauthUrl

参数是否必填说明
grant_type是授权类型,填写:refresh_token(固定写死)
client_id是应用 id(客户端向服务端申请)
client_secret是应用秘钥(客户端向服务端申请)
refresh_token是2 中获取到的刷新 token

响应参数

参数类型最大长度备注示例
codeInt-状态码200
msgString-状态码描述ok
dataObject-返回数据
data.access_tokenString-tokenxxx
data.refresh_tokenString-刷线 tokenxxx
data.expires_inInt-token 过期时间(单位:秒)1799
data.refresh_expires_inInt-刷新 token 过期时间(单位:秒)2591999
data.client_idString-应用 id
data.scopeString-此令牌包含的权限userinfo
data.openidString--null

响应示例

xml
{
  "code": 200,
  "msg": "ok",
  "data": {
    "access_token": "0DCoL8OuELw8xJ2zVrVBibXAvGhhJtWIfitoGkun1UZZnGjI3JGyqjbqtD1Z",
    "refresh_token": "pICFPHKSsvFP7ZVQKSw9UtHvN0EajndbE5p9q5Qs6dKUru80zEFsrMMyystk",
    "expires_in": 7199,
    "refresh_expires_in": 2591999,
    "client_id": "1001",
    "scope": "userinfo",
    "openid": null
   }
}
{
  "code": 200,
  "msg": "ok",
  "data": {
    "access_token": "0DCoL8OuELw8xJ2zVrVBibXAvGhhJtWIfitoGkun1UZZnGjI3JGyqjbqtD1Z",
    "refresh_token": "pICFPHKSsvFP7ZVQKSw9UtHvN0EajndbE5p9q5Qs6dKUru80zEFsrMMyystk",
    "expires_in": 7199,
    "refresh_expires_in": 2591999,
    "client_id": "1001",
    "scope": "userinfo",
    "openid": null
   }
}

Released under the MIT License.