- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2018 02:34 AM
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
Solved! Go to Solution.
- Labels:
-
Personal Developer Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2018 07:22 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2018 01:10 AM
Hi Aman,
You are right, this issue seems to relevant to POSTMan, I exported same URLs to SOAP UI & its working fine, Really appreciated your help.
I have one more questions in this regards, What exact Role it should be for Oauth User to work all REST (Table) APIs, i tried with "Web_service_admin" & "rest_api_explore" roles but getting following Error, however, it works like a charm if uses "Admin" role.
{
"error": {
"message": "User Not Authorized",
"detail": "1 records constrained due to ACL restrictions"
},
"status": "failure"
}
Thanks,
Dheeraj Namdeo..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2018 02:20 AM
Dheeraj,
The roles you described will give access to the WebServices. To perform any Database Operations(CRUD) using REST, your Service Account must have proper roles needed to access the target tables.
It works for Admin Role because, Admin role has access to All the tables. So to make it work, find out which roles have access to the the target tables in your system and assign those roles to the Service Account.
Thank you,
Aman