oauth_token.do empty response body
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2015 02:37 PM
Hi Team,
I have been trying to request the access token, i have double checked my credentails and also made sure that the Oauth client id and secret are active, but I always get an empty response body
on commandline curl
curl -d "grant_type=password&client_id={client_id}&client_secret={client_secret}&username={username}&password={password}" https://{instancename}.service-now.com/oauth_token.do
on fiddler and RequestMaker
url: https://{instancename}.service-now.com/oauth_token.do
Request type: POST
request body: grant_type=password&client_id={client_id}&client_secret={client_secret}&username={username}&password={password}
Can someone please advise, why is the response 200 but the response body is empty. I never receive the accesstoken.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2015 06:10 PM
Keshav,
Did you try using rest console?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2015 11:07 PM
The same request works fine with Rest Console... I am getting the access token in the Response Body.
How can there be different results for two http clients?
This time I tried the curl online tool to test the response, its still without the accesstoken
curl -H "Accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=password&client_id={client_id}&client_secret={client_secret}&username={username}&password={password}" https://{instanceurl}.service-now.com/oauth_token.do
Please advise how could I get this working on a curl request as I am having the same issue with the PHP that I am using for my integration requirement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2015 10:36 AM
Hi Keshav,
I am wondering if a -i flag for curl might help.
-i, --include
(HTTP) Include the HTTP-header in the output. The HTTP-header
includes things like server-name, date of the document, HTTP-
version and more...
Edit:
This is just a guess - possibly wrong 😉
Best Regards
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2015 12:21 PM
Hi Tony,
The option for -i provides me information on the request, which is a 200 OK which means there should be a response body.
But I do not see the access token yet.
HTTP/1.1 200 OK
Set-Cookie: JSESSIONID={xxx988A4F8896400D08FE};Secure; Path=/; HttpOnly
Set-Cookie: glide_user_route=glide.{xxx988A4F8896400D08FE};secure; Expi
res=Sun, 19-Dec-2083 23:32:56 GMT; Path=/; HttpOnly
Set-Cookie: glide_session_store={xxx988A4F8896400D08FE}; Expires=Tue, 0
1-Dec-2015 20:48:49 GMT; Path=/; HttpOnly
Content-Length: 0
Date: Tue, 01 Dec 2015 20:18:49 GMT
Server: ServiceNow
Set-Cookie: BIGipServerpool_{xxx988A4F8896400D08FE}=2692744714.38718.0000; path=/