创建认证成功跳转的模版
Headers
Authorization: OAuth the-session-uuidBody
{
"params": {
"name": "test",
"description": "desc",
"clientUuid": "64053daa6b56335d843b3fb837fd8133",
"redirectTemplate": "http://172.24.194.28:5000/oauth1/verify/?username=${username}&sessionId=${sessionId}&userUuid=${userUuid}&accountUuid=${accountUuid}&loginType=${loginType}&userType=${userType}'"
},
"systemTags": [],
"userTags": []
}上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"test","description":"desc","clientUuid":"64053daa6b56335d843b3fb837fd8133","redirectTemplate":"http://172.24.194.28:5000/oauth1/verify/?username=${username}&sessionId=${sessionId}&userUuid=${userUuid}&accountUuid=${accountUuid}&loginType=${loginType}&userType=${userType}'"}}' \
http://localhost:8080/zstack/v1/create/sso/redirect/template/参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| name | String | body(包含在params结构中) | 资源名称 | 4.3.0 | |
| description | String | body(包含在params结构中) | 资源的详细描述 | 4.3.0 | |
| clientUuid | String | body(包含在params结构中) | 对应的 SSO 客户端 UUID,即第三方账户源的 UUID | 4.3.0 | |
| redirectTemplate | String | body(包含在params结构中) | 跳转的模版 | 4.3.0 | |
| resourceUuid (可选) | String | body(包含在params结构中) | 资源 UUID | 4.3.0 | |
| tagUuids (可选) | List | body(包含在params结构中) | 标签 UUID 列表 | 4.3.0 | |
| systemTags (可选) | List | body | 系统标签 | 4.3.0 | |
| userTags (可选) | List | body | 用户标签 | 4.3.0 |
API返回
返回示例
{
"inventory": {
"uuid": "8b233284793c3da397f6ebd7351c3a54",
"name": "test",
"description": "desv",
"clientUuid": "827d2ea3ae8133bbba0b726c1d8e716d"
}
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| success | boolean | 创建是否成功 | 4.3.0 |
| inventory | SSORedirectTemplateInventory | 详情参考inventory | 4.3.0 |
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 4.3.0 |
inventory
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 模版的 UUID,唯一标示该资源 | 4.3.0 |
| name | String | 模版名称 | 4.3.0 |
| description | String | 模版的详细描述 | 4.3.0 |
| clientUuid | String | 对应的 SSO 客户端 UUID,即第三方账户源的 UUID | 4.3.0 |
| redirectTemplate | String | 跳转的模板 | 4.3.0 |
| createDate | Timestamp | 创建时间 | 4.3.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 4.3.0 |
error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 0.6 |
| description | String | 错误的概要描述 | 0.6 |
| details | String | 错误的详细信息 | 0.6 |
| elaboration | String | 保留字段,默认为null | 0.6 |
| opaque | LinkedHashMap | 保留字段,默认为null | 0.6 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 0.6 |
SDK示例
Java SDK
CreateSSORedirectTemplateAction action = new CreateSSORedirectTemplateAction();
action.name = "test";
action.description = "desc";
action.clientUuid = "64053daa6b56335d843b3fb837fd8133";
action.redirectTemplate = "http://172.24.194.28:5000/oauth1/verify/?username=${username}&sessionId=${sessionId}&userUuid=${userUuid}&accountUuid=${accountUuid}&loginType=${loginType}&userType=${userType}'";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSSORedirectTemplateAction.Result res = action.call();Python SDK
CreateSSORedirectTemplateAction action = CreateSSORedirectTemplateAction()
action.name = "test"
action.description = "desc"
action.clientUuid = "64053daa6b56335d843b3fb837fd8133"
action.redirectTemplate = "http://172.24.194.28:5000/oauth1/verify/?username=${username}&sessionId=${sessionId}&userUuid=${userUuid}&accountUuid=${accountUuid}&loginType=${loginType}&userType=${userType}'"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSSORedirectTemplateAction.Result res = action.call()