鉴权接口
请求说明
请求头
| 参数名 | 中文名称 | 必须 | 示例值 | 描述 |
|---|---|---|---|---|
| Authorization | 认证信息 | 必须 | Basic UnFCMkhKdNOWk9xWA== | 使用 client_id 和 client_secret 进行 Base64 编码认证,格式为 base64(client_id:client_secret) |
| Content-Type | 数据类型 | 必须 | application/x-www-form-urlencoded | 使用表单方式提交参数 |
请求参数
| 参数名 | 中文名称 | 必须 | 类型 | 描述 |
|---|---|---|---|---|
| grant_type | 授权类型 | 是 | String | 固定值 client_credentials |
请求示例
bash
POST https://{your_domain}/api/v2/tenant/token
Authorization: Basic UnFCMkhKdGt6bFU...aT0NObkk4NlNOWk9xWA==
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials返回示例
成功示例
json
{
"access_token": "e665e923-9904",
"token_type": "bearer",
"expires_in": 1719,
"scope": "all",
"id_token": "eyJraWMSIs.eyJQwWVzQOrwNYo.ELddR0yVUQXgupYWNtS"
}token过期或失效错误示例
HTTP Status: 400
json
{
"error": "invalid_token",
"error_description": "Invalid access"
}返回参数
| 参数名 | 中文名称 | 类型 | 描述 |
|---|---|---|---|
| access_token | 调用接口令牌 | String | 后续所有接口访问均需提供此参数 |
| token_type | 令牌类型 | String | 默认为bearer |
| expires_in | 过期时间 | int | 单位秒, 默认1800s |
| scope | 授权范围 | String | 默认是all |