{ "ownerApp" : "Orchestrator", "name" : "group_deleted", "createBy" : "Marco Lettere", "description": "Handle workflow related to Portal event group_created", "version" : 1, "ownerEmail" : "marco.lettere@nubisware.com", "inputParameters" : ["user", "group"], "tasks" : [ { "name": "LAMBDA_TASK", "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" : "lookup_client", "type" : "SIMPLE", "inputParameters" : { "url" : "${init.input.keycloak_admin}/clients", "params" : { "clientId" : "${workflow.input.group}"}, "method" : "GET", "headers" : { "Authorization" : "Bearer ${authorize.output.body.access_token}", "Accept" : "application/json" } } }, { "name" : "pyrest", "taskReferenceName" : "delete_client", "type" : "SIMPLE", "inputParameters" : { "url" : "${init.input.keycloak_admin}/clients/${lookup_client.output.body[0].id}", "method" : "DELETE", "headers" : { "Authorization" : "Bearer ${authorize.output.body.access_token}" } } } ] }