Create SSO Redirect Template

POST/zstack/v1/create/sso/redirect/template/

Headers

Authorization: OAuth the-session-uuid

Body

{
  "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": []
}

In the preceding example, the systemTags and userTags fields are optional. They are listed here to show that the body can contain these two fields.

Curl Example

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/

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
nameStringbody (enclosed in the params structure)Resource name 4.3.0
descriptionStringbody (enclosed in the params structure)Detailed description of the resource 4.3.0
clientUuidStringbody (enclosed in the params structure)UUID of the corresponding SSO client, which is the UUID of the third-party account source 4.3.0
redirectTemplateStringbody (enclosed in the params structure)Redirect template 4.3.0
resourceUuid (Optional)Stringbody (enclosed in the params structure)Resource UUID 4.3.0
tagUuids (Optional)Listbody (enclosed in the params structure)Tag UUID list 4.3.0
systemTags (Optional)ListbodySystem tags 4.3.0
userTags (Optional)ListbodyUser tags 4.3.0

API Response

Response Example

{
  "inventory": {
    "uuid": "8b233284793c3da397f6ebd7351c3a54",
    "name": "test",
    "description": "desv",
    "clientUuid": "827d2ea3ae8133bbba0b726c1d8e716d"
  }
}
NameTypeDescriptionStarting Version
successbooleanWhether the creation is successful4.3.0
inventorySSORedirectTemplateInventoryFor details, see inventory4.3.0
errorErrorCodeError code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error4.3.0

inventory

NameTypeDescriptionStarting Version
uuidStringTemplate UUID. Uniquely identifies the resource.4.3.0
nameStringTemplate name4.3.0
descriptionStringDetailed description of the template4.3.0
clientUuidStringUUID of the corresponding SSO client, which is the UUID of the third-party account source4.3.0
redirectTemplateStringRedirect template4.3.0
createDateTimestampCreation time4.3.0
lastOpDateTimestampLast modification time4.3.0

error

NameTypeDescriptionStarting Version
codeStringError code number. The globally unique identifier of the error, for example, SYS.1000 or HOST.1001.0.6
descriptionStringBrief description of the error0.6
detailsStringDetailed information about the error0.6
elaborationStringReserved field. Default is null.0.6
opaqueLinkedHashMapReserved field. Default is null.0.6
causeErrorCodeRoot error. The source error that caused the current error. This field is null if no root error exists.0.6

SDK Examples

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()