get oauth token from extarnal system using the rest action step

Ketan Pandey
Tera Expert

HI ,

 

Anybody has used to REST Step in flow designer action to get the Oauth token from external system,if yes .

Could you please share me some details.

 

What is the use of 'Request Type' and 'Request Body' ,do we need to put anything in the request body

1 ACCEPTED SOLUTION

@Ketan Pandey 

Better to have a custom action which can be re-used.

You can pass the details as input to that action, that action will use script step and give 1 output as the access token.

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

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@Ketan Pandey 

you will have to use Custom flow action to get the token using Script step within it.

Then pass that token as output of that flow action and then use that in your main flow.

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

Could you please share the example of script to get the oauth from external system

@Ketan Pandey 

Sure here you go, these links should help you, please enhance as per your requirement

OAuth2.0: Get new Access Token from existing Refresh Token

How to Setup OAuth2 authentication for outbound RESTMessageV2 integrations

OAuth : Script to Automate Token Request

How to generate the access token once it is expired from Business Rule?

How to get Auth Token using script when grant type is Authorization code

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

i am developing a spoke ,what is the recommended way to get the oauth token from an extran system.

script or rest step in action of flow designer or should use the outbound rest message