Workflow HTTP Request Action - How retrieve the access token value?

Hello my friends,
I’m finishing the auth process for my API that I will use in Workflow… but after reading the doc, it’s not much clear how Sailpoint will get the access token result…

My API will answer a json message { “access_token”: “valid_token” }, my question now is… how Sailpoint will know read this message if dont have any place to inform where is the valid token? should I just respond the valid_token as plain text?

My best regards!!

You can get it using {{$.hTTPRequest.body.access_token}} & {{$.hTTPRequest.body.valid_token}}

Here hTTPRequest is the technical name of the action returning the token.

1 Like

Where should I fill this? I need 2 HTTP Request actions? one to get the access_token and other to execute my real action? I’m using JWT Bearer… no I need get the acces_token from /login and pass it on header

Yes, in that case you need two HTTP requests. The first one will get the token and in the second one you can use token in header and execute your action.

Nice… but this delivered me a new question…

My “Login” endpoint has no auth needs, how and what is the best way to configure the HTTP Request Action that will make the login… I know that I need send username and password… but how its a safe way to store this and retrive this information into request body editor box?

Hey!! I got success…

  1. Just add the HTTP Request action… don’t chose any kind of authentication, configure URL and body params to login URL
  2. At the second HTTP Request, do the same, do not chose any kind of authentication, and now add a Request Header row: Authorization : Bearer {{$.hTTPRequest.body.access_token}}

Like this, I can post data to my API!!

Thanks!!

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.