69 lines
1.8 KiB
Django/Jinja
69 lines
1.8 KiB
Django/Jinja
{
|
|
"ownerApp" : "Orchestrator",
|
|
"name" : "invitation-accepted",
|
|
"createBy" : "Mauro Mugnaini",
|
|
"description": "Handle workflow related to Portal event invitation-accepted",
|
|
"version" : 1,
|
|
"ownerEmail" : "mauro.mugnaini@nubisware.com",
|
|
"inputParameters" : ["user", "first-name", "last-name", "email", "password"],
|
|
"tasks" : [
|
|
{
|
|
"name": "LAMBDA_TASK",
|
|
"taskReferenceName": "init",
|
|
"type": "LAMBDA",
|
|
"inputParameters": {
|
|
"keycloak": "{{ keycloak }}/{{ keycloak_realm }}",
|
|
"keycloak_admin" : "{{ keycloak_admin }}/{{ keycloak_realm }}",
|
|
"scriptExpression": "1"
|
|
}
|
|
},
|
|
{
|
|
"name" : "pyrest",
|
|
"taskReferenceName" : "authorize",
|
|
"type" : "SIMPLE",
|
|
"inputParameters" : {
|
|
"url" : "${init.input.keycloak}/protocol/openid-connect/token",
|
|
"method" : "POST",
|
|
"headers" : {
|
|
"Accept" : "application/json"
|
|
},
|
|
"body" : {
|
|
"client_id" : "orchestrator",
|
|
"client_secret" : "{{ keycloak_auth }}",
|
|
"grant_type" : "client_credentials"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name" : "pyrest",
|
|
"taskReferenceName" : "create_user",
|
|
"type" : "SIMPLE",
|
|
"inputParameters" : {
|
|
"url" : "${init.input.keycloak_admin}/users",
|
|
"expect" : 201,
|
|
"method" : "POST",
|
|
"body" : {
|
|
"username": "${workflow.input.user}",
|
|
"firstName": "${workflow.input.first-name}",
|
|
"lastName": "${workflow.input.last-name}",
|
|
"email": "${workflow.input.email}",
|
|
"credentials": [
|
|
{
|
|
"temporary": true,
|
|
"type": "password",
|
|
"value": "${workflow.input.password}"
|
|
}
|
|
],
|
|
"requiredActions": ["UPDATE_PASSWORD"],
|
|
"emailVerified": true,
|
|
"enabled": true
|
|
},
|
|
"headers" : {
|
|
"Authorization" : "Bearer ${authorize.output.body.access_token}",
|
|
"Content-Type" : "application/json"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|