Error: invalid_client when the next five minute quick start for PHP

I try the “Five Minute Quick Start” ( https://developers.google.com/drive/ ) and follow all the instructions until step 4 “Run the sample”. (I changed the client ID and secret in the example PHP code - I followed the texts and watched the video to make sure that I did not miss anything). When I run the script from the command line, I really get a link to follow - for example:

https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=http%3A%2F%2Flocalhost&client_id=938259907386.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%% 2Fdrive & access_type = offline & approval_prompt = force

But when I point my browser there (included in the Google console), I constantly get an error message:

Error: invalid_client ... and details:

response_type=code
scope=https://www.googleapis.com/auth/drive
redirect_uri=http://localhost
access_type=offline
approval_prompt=force
client_id=938259907386.apps.googleusercontent.com

I tried to remove the client ID and recreate, but I continue to work with the same error. Any suggestions on what could go wrong? Thank.

+5
source share

All Articles