diff --git a/workflows/request-response-trigger/AccessRequestPreapproval20230413.json b/workflows/request-response-trigger/AccessRequestPreapproval20230413.json new file mode 100644 index 0000000..888feb6 --- /dev/null +++ b/workflows/request-response-trigger/AccessRequestPreapproval20230413.json @@ -0,0 +1,40 @@ +{ + "name": "Access Request Preapproval", + "description": "Receive and respond to the access request preapproval event trigger. This workflow does preliminary processing on every access request to automatically determine if it should move on to the next approver in the chain or if it should fail immediately.", + "modified": "2023-04-13T16:30:07.903067305Z", + "definition": { + "start": "HTTP Request", + "steps": { + "HTTP Request": { + "actionId": "sp:http", + "attributes": { + "authenticationType": null, + "jsonRequestBody": { + "output": { + "approved": true, + "approver": "Workflow", + "comment": "This access has passed workflow approval." + }, + "secret": "{{$.trigger._metadata.secret}}" + }, + "method": "post", + "requestContentType": "json", + "url.$": "$.trigger._metadata.callbackURL" + }, + "nextStep": "success", + "type": "action", + "versionNumber": 2 + }, + "success": { + "type": "success" + } + } + }, + "trigger": { + "type": "EXTERNAL", + "attributes": { + "clientId": "862aa98b-f39b-490c-97af-49d23ad18102", + "url": "/beta/workflows/execute/external/a0e1c956-556c-4c2f-9c19-82ae9b71e1dc" + } + } +} \ No newline at end of file diff --git a/workflows/request-response-trigger/UpdateAccessRequestPreapprovalAccessToken20230418.json b/workflows/request-response-trigger/UpdateAccessRequestPreapprovalAccessToken20230418.json new file mode 100644 index 0000000..ad79b8d --- /dev/null +++ b/workflows/request-response-trigger/UpdateAccessRequestPreapprovalAccessToken20230418.json @@ -0,0 +1,84 @@ +{ + "name": "Update Access Request Preapproval Access Token", + "description": "", + "modified": "2023-04-18T14:10:36.785966514Z", + "definition": { + "start": "HTTP Request", + "steps": { + "HTTP Request": { + "actionId": "sp:http", + "attributes": { + "authenticationType": null, + "method": "post", + "url": "https://{tenant}.api.identitynow.com/oauth/token", + "urlParams": { + "client_id": "862aa98b-f39b-490c-xxx-xxxxx", + "client_secret": "6ebf9b15xxxxxx", + "grant_type": "client_credentials" + } + }, + "nextStep": "HTTP Request 1", + "type": "action", + "versionNumber": 2 + }, + "HTTP Request 1": { + "actionId": "sp:http", + "attributes": { + "authenticationType": "OAuth", + "jsonPatchRequestBody": [ + { + "op": "replace", + "path": "/httpConfig/bearerTokenAuthConfig/bearerToken", + "value": "{{$.hTTPRequest.body.access_token}}" + } + ], + "jsonRequestBody": { + "description": "", + "enabled": true, + "httpConfig": { + "basicAuthConfig": null, + "bearerTokenAuthConfig": { + "bearerToken": "{{$.hTTPRequest.body.access_token}}" + }, + "httpAuthenticationType": "BEARER_TOKEN", + "httpDispatchMode": "ASYNC", + "url": "https://{tenant}.api.identitynow.com/beta/workflows/execute/external/{id}" + }, + "name": "Workflow", + "responseDeadline": "PT1H", + "triggerId": "idn:access-request-pre-approval", + "triggerName": "Access Request Submitted", + "type": "HTTP" + }, + "method": "patch", + "oAuthClientId": "1758c03fdbf64401876f69b6c6e2c7b7", + "oAuthClientSecret": "$.secrets.5919bcbf-8f1d-4d96-9747-63634446ff10", + "oAuthCredentialLocation": "oAuthInHeader", + "oAuthTokenUrl": "https://devrel.api.identitynow.com/oauth/token", + "requestContentType": "json-patch+json", + "url": "https://{tenant}.api.identitynow.com/beta/trigger-subscriptions/{id}" + }, + "nextStep": "success", + "type": "action", + "versionNumber": 2 + }, + "success": { + "type": "success" + } + } + }, + "trigger": { + "type": "SCHEDULED", + "attributes": { + "cronString": "0 0 * * 0", + "frequency": "weekly", + "timeZone": "America/New_York", + "weeklyDays": [ + "Sunday" + ], + "weeklyTimes": [ + "00:00" + ] + } + } +} \ No newline at end of file