Skip to content

鉴权接口

请求说明

请求头

参数名中文名称必须示例值描述
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

竹云IDaaS开放平台