Web service Connector SaaS - OAuth 2.0 Authentication including several calls

Hi,
I’m having issues finding a step by step guide for how to set up OAuth2 authentication for a Web sevice SaaS source where there need to be made two calls for the authentication instead of one.

As you see we need to use the attributes in a more special way also

The authentication involves the following two calls:

1. Login Auth
URL: {{URL}}/v1/oauth2/authorize
Method: GET
Params: no params
Auth type: No auth
Headers: client_id, client_secret, grant_type
Body: no body
Attribute to save from response body: jsonData.value (saved as authorization_code)

2. Login Get token
URL: {{URL}}/v1/oauth2/token?grant_type=authorization_code&client_id={{Client-ID}}&source=RESTAPI&state=8
Method: GET
Params: grant_type, client_id, source, state
Auth type: No auth
Headers: username, password, authorization_code (from call 1)
Body: no body
Attribute to save from response body: jsonData.access_token

After these two we can do the original call to aggregate roles for example.

3. Aggregation roles
URL: {{URL}}/v1/securityrole
Method: GET
Params: no params
Auth type: Bearer Token (Token = access_token from call 2)
Headers: user, password, site_name, Content-Type, count
Body: no body

Do any one of you have experience of setting up something like this and are able to guide me how to this the correct standardized way?

Hi,

You can use two custom authentication calls like below.

In my usecase, we get assertion code from first API call, adding it to second API call.

Second custom authentication call will give the access token, using the same for all operations.

-Abhinov

But how do you link the two authentication calls together?
I can’t seem to find the choice “parent endpoint” like I use for aggregation.

And how do you reference in the response mapping?

SailPoint will call the operations in the order we define. The output from the first operation will be used in second where the response will be saved in a variable. This variable can be used in second operation.

For this response mappings need to be defined in first operation. In your case it is like
Authorization_Code(Schema Attribute) $.jsondata.value(Attribute Path) Note: To check the correct attribute path user JSON finder tool
E.g

Hi,

You can use it. It will work. ISC will call the operations in sequence.

Either you can take this approach or you need to write a Webservice Before Operation rule to call the first API and fetch the auth code and pass it to the API call.

Below is documentation of WSBO.

-Abhinov

This doesn’t seem to work. I don’t really understand how ISC can know which Authentication call it should start with.

Hello @iamjenny ,

If it doesnt seem to work, you can also use an after rule. It is also a connector rule and is very easy to implement. You can see the following documentation: IdentityNow Rule Guide - Web Services After Operation Rule - Compass

Kind regards,
Pablo