changed code for invitation workflow which was wrong

This commit is contained in:
dcore94 2020-10-07 12:27:17 +02:00
parent 4f168491d0
commit c8e64192c1
1 changed files with 66 additions and 12 deletions

View File

@ -1,14 +1,68 @@
{ {
"model-class-name": "com.liferay.portal.model.Group", "ownerApp" : "Orchestrator",
"sender": "gcube", "name" : "invitation-accepted",
"name": "invitation-accepted", "createBy" : "Mauro Mugnaini",
"type": "portal", "description": "Handle workflow related to Portal event invitation-accepted",
"uuid": "73de5431-3920-4dc2-b00d-70a976891f7d", "version" : 1,
"timestamp" : "2020-07-24T12:09:24.585Z", "ownerEmail" : "mauro.mugnaini@nubisware.com",
"user": "gino.stilla", "inputParameters" : ["user", "first-name", "last-name", "email", "password"],
"password" : "123456", "tasks" : [
"first-name" : "Gino", {
"last-name" : "Stilla", "name": "LAMBDA_TASK",
"email" : "gino@stilla.com" "taskReferenceName": "init",
"type": "LAMBDA",
"inputParameters": {
"keycloak": "https://accounts.dev.d4science.org/auth/realms/d4science",
"keycloak_admin" : "https://accounts.dev.d4science.org/auth/admin/realms/d4science",
"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" : "c93501bd-abeb-4228-bc28-afac38877338",
"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"
}
}
}
]
} }