Problem with Rest Messgae OAuth2 Profile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2020 12:34 AM
Hello community,
I am setting up a REST Message with one POST method. This should use OAuth2 profile with Grant Type Client Credentials. My URL and credentials are correct. However, when I try to test the REST Method, I am getting following error:
The request failed: java.net.SocketTimeoutException: connect timed out when posting to https://xxxxxxxxxx.service-now.com/nav_to.do?uri=oauth_entity.do?sys_id=1420f7bddb3e8794862f3318f49619d9%26syspa
I tried to run this method via script. I got this error:
Error: Problem retrieving authentication profile
Even though I have no typo in the profile name (and SNOW says the param is profile name, not sys_id).
I am sending my OAuth Profile and Rest Message attached. One more thing - when I click get oAuth token, this expiration date time is always the same as the date time I click it, eg. it expires instantly - might this be the problem?
Any suggestions are more than welcomed!
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2020 02:09 AM
Two conclusions from your issue
1) As you may suspect based on the name, the SocketTimeoutException
is thrown when a timeout occurs during a read or acceptance message within a socket connection, this means there can be some issue at their end as well while sending the response.
2) Or your token keeps expiring after certain minute and you havent wrote code to refresh it
Check the below links for
1) Whether token has expired ?
2) Refreshing the token
Mark my ANSWER as CORRECT and HELPFUL if it helps.