Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

invalid_client in google oauth2

I try to make a web page for youtube video upload, therefore I try to get the client id from google api console, and in the api console it shows something like this:

Client ID: 533832195920.apps.googleusercontent.com Redirect URIs: http://bobyouku.ap01.aws.af.cm/testyoutube.php https://developers.google.com/oauthplayground 

However when I try to test my account using the following URL:

https://accounts.google.com/o/oauth2/auth?client_id=533832195920.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Fbobyouku.ap01.aws.af.cm%2Ftestyoutube.php&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube&response_type=code&access_type=offline

It gives out the result of invalid_client. Even when I try it on oauth2 playground, same fail occurs

So anyone knows what's happen?

like image 687
Bob Avatar asked Jun 18 '13 10:06

Bob


People also ask

What is redirect URI in oauth2 Google?

The redirect URIs are the endpoints to which the OAuth 2.0 server can send responses. These endpoints must adhere to Google's validation rules. For testing, you can specify URIs that refer to the local machine, such as http://localhost:8080 .

Is Google Authenticator oauth2?

Google APIs use the OAuth 2.0 protocol for authentication and authorization. Google supports common OAuth 2.0 scenarios such as those for web server, client-side, installed, and limited-input device applications.


1 Answers

Set/change your product name, I had this issue until I created a product name as same as project name.

The product name can be set in the Consent screen section of the Google Developers Console for your project. Look under APIs & auth in the left navigation and select Consent screen. You need also to set your email address in the box above the product name.

like image 183
jojay Avatar answered Sep 19 '22 18:09

jojay