0
votes

I'm trying to use the "omniauth-google-oauth2" gem in rails. I've registered my application to the cloud console as a web app, and trying to get it working, but when I try to access this url: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=XXX.project.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fusers%2Fauth%2Fgoogle_oauth2%2Fcallback&state=5d7e3e04fffd3bfd4c7716a53c96583047d200b285db60a3&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&access_type=offline

it throws Google's "Error: invalid_client" page at me. The client id and secret I took from the json they give on the api and auth's section..

What do you think could be the problem?

3

3 Answers

1
votes

hmmm.. You have XXX.project.googleusercontent.com but client_ids typically have xxx.apps.googleusercontent.com. Try copy-and-paste from the API console to rule out the possibility of typos.

1
votes

I also was having a similar issue. For some reason if you change the app type from Web Application to other it does the trick.

0
votes

Very similar question here: invalid_client in google oauth2

A: Did the error also report that it was missing an application name? I had this issue until I created a project name (e.g. "Project X") in the project settings dialog.