Create Bearer token and use for user creation for Rest Integration

SHARAD KUMAR ME
Tera Contributor

Hi Team, 

I am doing a REST Integration using flow designer/workflow. For Authentication, I am using bearer token, which needs to be send in Authorization header.I cant use Oauth type credential as I don't have client Id and Client Secret. I have direct generated token. 

Requirement to create ServiceNow forms use designer/workflow to trigger REST API call to create token and use the same for user creation/Updation at Saviynt end.

Any inputs will be appreciated.

Thanks

1 ACCEPTED SOLUTION

Hi @SHARAD KUMAR ME ,

 Yes, this setup can be achieved with workflow/flow designer. For flow designer though, you would need to ensure that the REST Action Step is installed. If you're practicing with a PDI you would need to go to the SN Developer site and use the configurations in the header to install it.

click_activate_plugin.pngintegrationhub_plugins.png

 

After those are installed then you should be able to choose the REST Step in a Flow Action

rest_step.png

 

If you can't get the REST step at the moment it still can be done in a Flow. You would just have to setup the platform REST Message and then use a Script Action in the Flow.

 

Basically the setup would be one call to retrieve the token.

One call for refresh token.

Once call for using the token (actual call to retrieve data)

And of course you would be using the response from either of the token retrievals and using the response in the call for data retrieval using the pills of the Flow.

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@SHARAD KUMAR ME 

will it be the same token all the time?

Are you using OAuth for this?

Didn't get your requirement?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Token is short lived ,new token to be created every time request is submitted.

No Saviynt do not support OAuth.

I may not be able to explain it technically ,doing it first time.

Requirement to create ServiceNow forms use flow designer/workflow to make REST API call to create token and use the created dynamically and push new user /Update (payload) to Saviynt.

Hope I am bit clear this time.

Thanks

 

@SHARAD KUMAR ME 

Sorry very difficult to understand

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

ChrisBurks
Mega Sage

Hi @SHARAD KUMAR ME 

 

According to Saviynt's documentation you are correct that a bearer token needs to be sent in Authorization header but before that an initial request needs to be made to retrieve that token. In that initial request the Saviynt service account credentials need to be sent in the token request. Token would then be extracted from the initial request and placed into the request for data.

Sequence:

  1. Token request (a POST request with the credentials in the body of the request)
    1. Note: the response will also include a refresh token which can be used afterwards to get new tokens
  2. Retrieved token can be used to send a GET request ( token should be in the header as a bearer authorization)

From the Saviynt documentation :

https://docs.saviyntcloud.com/bundle/API-Reference-Guide/page/Content/Overview.htm 

ChrisBurks_0-1736949977011.png

 

From the documentation they supply a practice playground and a Postman setup

https://docs.saviyntcloud.com/bundle/API-Reference-Guide/page/Content/API-References.htm

ChrisBurks_1-1736950229669.png

 

https://documenter.getpostman.com/view/36611902/2sAXxV6APE

ChrisBurks_2-1736950324119.png