Pass authorizations as parameters to securely share a single workflow with multiple users. Know how parameterized authorizations work, and how to configure parameterized authorizations for one or more actions, with the help of an example.
Parameterized authorization allows you to change which accounts you access on the fly based on the encrypted authorization you send in your webhook. This additional flexibility allows you to centrally manage company workflows for multiple users without creating multiple workflows.
Let’s see the steps to create a parameterized authorization for service actions with the help of an example.
Example
No subtopics in this section
Let’s say you have an existing workflow that, when triggered through webhook, creates a card in Trello, and sends the card details through email.
Let’s create a dynamic, or parameterized account for Trello and Gmail.
Retrieve service access token and create object.
Using your account’s OAuth server, create an access token for the service (in this case, Trello) and insert it in the access_token field of the following object. This is the standard object to be used for all service actions:
Here, a0 refers to the Id of the action you want to create a parameterized account for. You can find this Id at the lower-left corner of the action configuration window as shown below:
Next, retrieve an access token for the Gmail service and add it to the object for Gmail service. Add this object below the Trello object. So, it becomes:
Encode object. Once you have created the object, encode it with base64 encoding. You can use this online service to encode the object.
Append encoded object to webhook URL.
Once you have encoded the object, you can append it to the webhook URL of the workflow you wish to execute. Add ?authorizations= to your webhook URL, followed by your encoded object.
For example, if https://runflow.built.io/run/8… is the webhook URL of the workflow, add ?authorizations= followed by the encoded data. Your webhook URL will look something like this: https://runflow.built.io/run/8…?authorizations=IFsgDQogICAgICAgeyANCiAgICAgICAgICJ0b2tlbiIgO…
Execute the webhook URL. Now, when you execute the above webhook URL, it will call the workflow and replace the existing accounts with the parameterized accounts.
Creating a parameterized authorization for multiple actions of the same connector
No subtopics in this section
If you are using multiple actions from the same service, you do not need to create different objects for each of them. You simply need to add their corresponding Ids in the Actions array of the existing object for that service.
For example, in the workflow below, the object for Trello service will be:
For the client_id field, you can either enter 4a6607072d198fc64a4b (the client ID supported by IBM webMethods Integration auth server) or can create your own client ID using your auth server or oAuth app.