Oauth API is Returning an error as "This site requires JavaScript to be enabled" with entire javascript code

Dheeraj N
Kilo Contributor

I configured an OAuth user to generate auth access_token & refresh_token, whenever we invoke "oauth_token.do", first time it returns both token, but when we start consuming that token to get Incident details it shows random errors. Firstly it shows "ACL" error and in a 2nd attempt, it returns blank JSON output as [].

Then if we try to hit "oauth_token.do" API again to get tokens, it also starts returning some javascript error as "This site requires JavaScript to be enabled" with entire Javascript code. (refer attached error file)

I am unable to figure out, why is this API misbehaving sometimes without any changes? Is someone faced the same issue or anyone can help me to resolve this?

Thanks in advance.

Attached the error log & images for Oauth APIs.

Regards,

Dheeraj Namdeo

1 ACCEPTED SOLUTION

ARG645
Tera Guru

Then if we try to hit "oauth_token.do" API again to get tokens, it also starts returning some javascript error as "This site requires JavaScript to be enabled" with entire Javascript code. (refer attached error file)

I faced the exact same issue. I believe its something to do with PostMan, the initial request to obtain access_token and refresh_token works for oauth_token.do. But after we consume it, it says "This site requires JavaScript to be enabled" (with a Login Screen).

Though we get this in Post Man for testing purposes, we never got this issue in real time production environment(As they dont use PostMan)

Note:- I only saw this behavior with Grant Type of Resource Owner Password Credentials. (Or simply grant type = password)

Please mark the answer Correct/Helpful if applicable so that it will help others in future.

View solution in original post

11 REPLIES 11

Dheeraj N
Kilo Contributor

Hi,

 

Can someone help here. We are still getting these errors

 

Regards,

Dheeraj 

Hi Dheeraj,

Did you check the life span of both access token and refresh token?

Regards

Ankur

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

Yes, following are the values

 
 

Hi Dheeraj,

Can you check with the 3rd party whether they are getting the same error when they consume this?

Because it seems it is giving issue to you when you are consuming it either via postman or chrome rest api plugin.

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

ARG645
Tera Guru

Then if we try to hit "oauth_token.do" API again to get tokens, it also starts returning some javascript error as "This site requires JavaScript to be enabled" with entire Javascript code. (refer attached error file)

I faced the exact same issue. I believe its something to do with PostMan, the initial request to obtain access_token and refresh_token works for oauth_token.do. But after we consume it, it says "This site requires JavaScript to be enabled" (with a Login Screen).

Though we get this in Post Man for testing purposes, we never got this issue in real time production environment(As they dont use PostMan)

Note:- I only saw this behavior with Grant Type of Resource Owner Password Credentials. (Or simply grant type = password)

Please mark the answer Correct/Helpful if applicable so that it will help others in future.