员工身份(EIAM)

鉴权接口

IDaaS身份API
最后更新时间: 1/22/2024, 6:45:10 PM

# 请求说明

POST https://{your_domain}/api/v2/tenant/token

# 请求头

参数名 中文名称 必须 示例值 描述
Authorization 认证信息 必须 Basic UnFCMkhKdNOWk9xWA== 使用client_id和client_secret进行basic64认证,
格式为: base64(client_id:client_secret)
Content-Type 数据类型 必须 application/x-www-form-urlencoded 使用表单方式提交参数

# 请求示例

POST https://{your_domain}/api/v2/tenant/token

Authorization: Basic UnFCMkhKdGt6bFU...aT0NObkk4NlNOWk9xWA==

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

grant_type=client_credentials

# 请求参数

参数名 中文名称 必须 示例值 描述
grant_type 授权类型 String 固定值client_credentials

# 返回示例

正确返回示例
HTTP Status: 200 OK
{
    "access_token": "0d61dde4-c700-4269-b1c9-16b5922ce888",
    "token_type": "bearer",
    "expires_in": 1799,
    "scope": "all",
    "id_token": "eyJraWMSIs.eyJQwWVzQOrwNYo.ELddR0yVUQXgupYWNtS"
}

token过期或失效错误示例
HTTP Status: 400
{
    "error": "invalid_token",
    "error_description": "Invalid access"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

# 返回参数

参数名 中文名称 类型 描述
access_token 调用接口令牌 String 后续所有接口访问均需提供此参数
token_type 令牌类型 String 默认为bearer
expires_in 过期时间 int 单位秒,默认1800s
scope 授权范围 String 默认是all
id_token 授权认证信息 String 应用授权的权限信息

# Postman调用示例