文档

刷新Token

更新时间:

当 Access Token 即将过期时,使用 RefreshToken 获取新的 Access Token。

API

POST /api/v1/token

请求参数

Body

Content-Type: application/x-www-form-urlencoded

名称

类型

是否必选

描述

grant_type

String

固定字符串 “client_credentials”

refresh_token

String

刷新时使用的刷新凭据

scope

String

新 Access Token 的权限,多个权限使用空格( )分割, 默认为刷新凭据的全部权限

access_token_lifetime

Integer

新 Access Token 的有效时间,单位秒,默认1个小时,最长12个小时

返回结果

名称

类型

描述

token_type

String

Access Token 类型,固定值 “bearer”

access_token

String

Access Token

expires_in

Integer

Access Token 的有效时间, 单位秒

示例

请求示例

curl -X POST "http://gateway.e2ehmfqasth.aliyunbaas.top:31113/api/v1/token" -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=refresh_token&scope=&refresh_token=<Your URL Encoded Refresh Token>"

正常返回示例

{
  "token_type": "bearer",
  "access_token": "eyJhbGciOi...rk6I",
  "expires_in": 3600
}

错误码

请参考错误码

  • 本页导读 (0)
文档反馈