Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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

@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

Getting this below error 

Ignore oauth entity from request. Use provider from oauth entity profile.
Ignore grant_type parameter in request. Use grant type from oauth entity profile.
OAuthProblemException{error='Unauthorized', description='null', uri='null', state='null', scope='null', redirectUri='null', responseStatus=0, parameters={}}
failed to get access token from remote oauth server.
*** Script: AccessToken:null
*** Script: AccessTokenExpiresIn:0
*** Script: RefreshToken:null