Andrei Rosu
Andrei Rosu

Reputation: 1387

Google OAuth2 response_type error on authorization code request

I'm trying to get an authorization code from Google+ API, as described in Step 1(Set authorization parameters) (HTTP/REST).

As I've read there, the Google authorization server has the following mandatory query string parameters: client_id, redirect_uri and scope, so my href would look like this:

https://accounts.google.com/o/oauth2/v2/auth?client_id=123002756467-dmq0soo7rlfc4on640hdsehnrvb700t7.apps.googleusercontent.com&redirect_uri=http://localhost:5000/oAuthCallback&scope=https://www.googleapis.com/auth/glass.location

When trying to access that link, I get the following error: Error: invalid_request (Required parameter is missing: response_type)

Though, the response_type parameter is not specified in that parameter list at all!

Any ideas how this can be solved?

Fixed. It seems that the spaces in my code editor were also inserted in my link as "%20", so that's why it didn't work.

Upvotes: 0

Views: 5148

Answers (1)

user2705223
user2705223

Reputation: 1325

Since you're following the server documentation, the response_type=code parameter is present in the sample authorization request URL in the next step [1].

You can learn more about response types here: https://developers.google.com/identity/protocols/OpenIDConnect#response-type

[1] https://developers.google.com/identity/protocols/OAuth2WebServer#redirecting

Upvotes: 1

Related Questions