Invalid grant_type: authorization_code

2,348 views
Skip to first unread message

oauth_astronaut

unread,
Aug 8, 2011, 10:01:53 AM8/8/11
to oauth...@googlegroups.com
Hi,

I'm trying out the OAuth2.0 API (great initiative!), but I'm stuck at the accesstoken call. I'm using the oauth 2.0 for native applications flow, following the example here http://code.google.com/intl/no-NO/apis/accounts/docs/OAuth2.html#IA
..ofc using my own clientid, secret and the generated authorization code from the auth call.

I can't seem to find any specific description about what this error means.
It would seem that the grant type authorization_code is invalid, but..that doesn't make any sense.

Any hints would be appreciated.

regards,
oauth_astronaut

oauth_astronaut

unread,
Aug 8, 2011, 10:19:56 AM8/8/11
to oauth...@googlegroups.com
additional info:
I experimented a bit swithing the order of the form elements.
Previous error occurred when grant_type was the last parameter.

If I put the redirect_uri=urn:ietf:wg:oauth:2.0:oob last, I get:

Invalid parameter value for redirect_uri: Missing authority: urn:ietf:wg:oauth:2.0:oob

Error 400

Doesn't make sense either. I understood that this is the string to use for native apps?

regards,
oauth_astronaut

oauth_astronaut

unread,
Aug 8, 2011, 10:29:07 AM8/8/11
to oauth...@googlegroups.com
Ok. problem found!

There was a lineshift char the api didn't handle at the end of the message body.

So which ever parameter was last gave some confusing error messages  :)

To reproduce: Use the "REST client for Firefox" plugin and press enter after the last parameter

regards,
oauth_astronaut

Ankit Kavi

unread,
Dec 4, 2012, 4:20:35 PM12/4/12
to oauth...@googlegroups.com
Hey oauth_astronaut,
I have been getting a similar error to yours when I ran the python sample script. When I tried to visit the link that is supposed to deliver my access token I would get the following error:

Invalid parameter value for redirect_uri: Missing authority: urn:ietf: wg:oauth:2.0:oob

How exactly did you solve this issue? Thanks!
Reply all
Reply to author
Forward
0 new messages