string postData = "code=" + token + "&client_id=yyy.apps.googleusercontent.com&client_secret=zzz&grant_type=authorization_code&redirect_uri=http%3A%2F%2Flocalhost%2Fhome%2Fgreturn";
OAuth2 oauth = new OAuth2(googleURL,postData);
}
byte[] buffer = Encoding.ASCII.GetBytes(postData);
What is the response that comes back with 400? Normally there should
be a JSON encoded error response. Do you see that?
Do you have access to a Linux or OS X machine to try the failing POST
using curl? The curl command is:
curl -d "grant_type=authorization_code&client_id=yyy.apps.googleusercontent.com&client_secret=zzz&redirect_uri=http%3A%2F%2Flocalhost%2Fhome%2Fgreturn&code=<token>"
https://sandbox.google.com/o/oauth2/token
(make sure you replace <token> with the actual authorization code and
use real client id and secret)
Marius
Looking at your request URL, some parts of it have been escaped (I.e. %2F) and others haven't. You'll need to get that straightened out first.
--
You received this message because you are subscribed to the Google Groups "Developer Forum for Google API Access using OAuth2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oauth2-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.