Hi,
I'm just wondering if anyone has solved the problem I (and many others) have been encountering when trying to setup oauth2 with Google?
I invariably encounter an 'invalid_grant' error when trying to exchange the code for an access token. To be specific, this happens after the user has successfully authorized my Google app, Google has posted a code to my callback, and my callback then has to issue a HTTPs post back to google to find out information about the user. At this point the invalid_grant error is returned with HTTP 400 (and with a HTTP expires header dating back to 1990).
I have this working for Facebook, and Twitter uses oauth1 so this step doesn't exist.
I've googled it quite a bit. Many people have encountered this error and no one seems to know what causes it. It isn't documented in Google's Authentication information (although other error conditions are, at times).
If you have solved this problem it'd be great if you could share how.
Cheers,
Nicholas
Content-Type: "application/x-www-form-urlencoded"
400
cache-control: "no-cache, no-store, max-age=0, must-revalidate"
pragma: "no-cache"
expires: "Fri, 01 Jan 1990 00:00:00 GMT"
date: "Wed, 18 Apr 2012 04:18:50 GMT"
content-type: "application/json"
x-content-type-options: "nosniff"
x-frame-options: "SAMEORIGIN"
x-xss-protection: "1; mode=block"
server: "GSE"
connection: "close"
{
"error" : "invalid_grant"
}