获取或刷新token
POST/auth/v1/token
2.根据refreshToken刷新token
Request
Query Parameters
client_id string
应用对应的客户端id,默认为环境id,可以不传
Header Parameters
x-device-id stringrequired
设备id
- application/json
Body
grant_type 获取token的授权方式 (string)nullable
code grant_type 为 authorization_code 时使用 (string)
refresh_token refresh_token 刷新token时, 使用 (string)
username grant_type 为 password时使用 (string)
password grant_type 为 password时使用 (string)
scope scope,可选 (string)
nonce 随机字符串, 可选 (string)
code_verifier PKCE: code_verifier (string)
device_code Device Code Flow https://tools.ietf.org/html/rfc8628 (string)
Responses
- 200
- 500
A successful response.
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
token_type token类型, 如Bearer类型 (string)
access_token 获取的jwt access_token (string)
refresh_token access_token对应的refresh_token, access_token过期可通过refresh_token刷新获取新的access_token (string)
id_token 用户身份信息的声明 (string)
expires_in int32
scope 授权范围 (string)
sub 用户的唯一id (string)
groups string[]
{
"token_type": "string",
"access_token": "string",
"refresh_token": "string",
"id_token": "string",
"expires_in": 0,
"scope": "string",
"sub": "string",
"groups": [
"string"
]
}
An unexpected error response.
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
error 错误信息 (string)
error_code int32
error_description 错误描述 (string)
{
"error": "string",
"error_code": 0,
"error_description": "string"
}
Loading...