how to use external client oAuth access token in inbound scripted REST API

Sagaya1
Giga Expert

Hi,

I have created the external client oAuth access token through https://<instance>.service-now.com/oauth_token.do.

How do i use this access token in scripted REST api script for authentication ?

 

Regards,

Sagaya.

1 ACCEPTED SOLUTION

@Sagaya 

Glad to know that it worked.

Please close the thread as answered by marking my response as correct and helpful If I was able to help/guide you.

Regards
Ankur

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

View solution in original post

24 REPLIES 24

Hi Ankur,

Thank you for your help and support ..

Cause of the issue :

1. Space issue in certificate

2.oAuth does not work if call another API in the scripted REST API script.

Now its working as expected .

 

Regards,

Sagaya Rajan.

 

 

 

Hi Sagaya,

So correct me if I am wrong

It worked well after making these changes

1) updating space in the certificate

2) you were calling another 3rd party API from Scripted REST API

a) Application ABC is consuming your scripted rest API endpoint using OAuth

b) inside the scripted REST script you are making REST Call to another 3rd party application DEF

Please provide some details so that it would be helpful to other community members as well.

If you think my response helped you feel free to mark answer as correct & helpful.

Regards
Ankur

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

Hi Ankur,

Please find the below details

It worked well after making these changes

1) updating space in the certificate

2) In the Scripted REST API I have used the  couple of table API which is process the table in the same instance and oAuthwas not working . 

  Have changed the code from Table API to 'GlideRecord' and  oAuth  working now.

 

Regards,

Sagaya Rajan.

 

@Sagaya 

Glad to know that it worked.

Please close the thread as answered by marking my response as correct and helpful If I was able to help/guide you.

Regards
Ankur

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

Hi Ankur,

Thank you for you help and support.

 

Regards,

Sagaya Rajan.