令牌端点
/api/oauth/token
post
/api/oauth/token令牌端点
请求体 · application/x-www-form-urlencoded必填
| 字段 | 类型 | 说明 |
|---|---|---|
| grant_type* | string · authorization_code | refresh_token | - |
| code | string | - |
| redirect_uri | string | - |
| client_id | string | - |
| client_secret | string | - |
| code_verifier | string | - |
| refresh_token | string | - |
响应
200令牌响应
| 字段 | 类型 | 说明 |
|---|---|---|
| access_token* | string | - |
| token_type* | string · Bearer | - |
| expires_in* | integer | 访问令牌有效期(秒),默认 3600。须在过期前用 refresh_token 续期。 |
| scope | string | - |
| refresh_token* | string | 授权码与刷新授予均返回。刷新时轮换;宽限期内重复使用旧值返回同一组新令牌。 |
| id_token | string | - |
400RFC 6749 错误
| 字段 | 类型 | 说明 |
|---|---|---|
| error* | string | - |
| error_description | string | - |
401客户端认证失败