We have a requirement where we need to execute some REST calls with Authorization type as OAuth 2.0. How can this be done through ITPAM?
Release : 4.3
Component : IT Process Automation
As with most Automation tools, there is usually more than one way to do something. This article will offer two methods.
Per the OAuth2.0 Specification/RFC (RFC 6749), the client_id must be encoded using the application/x-www-form-urlencoded algorithm.
This solution uses the HTTP Post Form. This is the recommended solution as it offers a way to more clearly read/track the key values as shown below - using the HTTP Post Form Information -> Form Fields. It should not require anything additional (for example, headers to specify Content-Type = application/x-www-form-urlencoded).
It is possible to use the HTTP Post operator. However, it involves a little more effort than using the HTTP Post Form. To use the HTTP Post operator you will need to:
Figure 2
Figure 3
Once your operator is working successfully, one way to use the access_token returned in other operators is to setup the HTTP Post Form's post-execution script to capture the result and add it to a Process variable. For example:
var response=Process[OpName].HTTPResponseContent;
var token = JSON.parse(response);
Process.access_token=token.access_token;
Please see here for more information on Operator Dataset Variables
Please see here for more information on HTTP Post Form Operator