Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is my google-signin-client_id

My web site used to have a link to let users login with their Google accounts in Open ID 2.0. Since 20.4.2015, this is no longer working, so I am trying to migrate to Google Sign-In.

This page: https://developers.google.com/identity/sign-in/web/sign-in#specify_your_apps_client_id

says:

Specify the client ID you created for your app in the Google Developers Console with the google-signin-client_id meta element.

I have no idea what my client ID is. In my Google Developers Console: https://console.developers.google.com/project

there is only a single, very old application I created with GoogleApp, which is not related at all to the website I am talking about. I tried using its project ID anyway, and got the following error after clicking the sign-in button:

401. That’s an error.

Error: invalid_client

The OAuth client was not found.
Request Details

    fetch_basic_profile=true
    scope=email profile openid
    response_type=permission
    redirect_uri=storagerelay://http/localhost?id=auth684995
    ss_domain=http://localhost
    client_id=imitatorgwt.apps.googleusercontent.com
    openid.realm=

That’s all we know.

What exactly should I write in the google-signin-client_id meta tag?

like image 573
Erel Segal-Halevi Avatar asked Apr 22 '15 09:04

Erel Segal-Halevi


1 Answers

You need to create/configure a Google OAuth client. For detailed instructions on how to do so for Google OpenID2 -> OpenID Connect migration, check out Google's migration dev docs (in particular the pieces related to Google Developers Console).

A possible work-flow is:

  • Go to Google Developer Console.
  • Under "Select a project" on the top, select "Create new project" and fill the details.
  • In the dashboard on the left, go to "API & Auth" -> Credentials.
  • Under "OAuth", click "Create new client ID".
  • Under "Application type", select "Web application".
  • Under "Authorized Javascript origins", enter the URL(s) of your website. The "Authorized redirect URLs" are updated automatically.
  • Click "Create client ID".
  • The new client ID can be accessed any time by going to "Credentials" in the left dashboard. It looks something like this: "3453453452345-dfgjw3456u2094mlfg45p.apps.googleusercontent.com".

Hope that helps!

UPDATE

We have updated the referred documentation with instructions on how to create Google projects+client ids, see https://developers.google.com/identity/sign-in/web/devconsole-project. That should make things easier for developers in the future.

Again, thanks for reporting the problem!

like image 158
Miguel Andres Avatar answered Sep 30 '22 18:09

Miguel Andres