Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

client_secret.json is empty upon download from google developer site

I am trying to download the client_secret.json from google API. I am following the steps listed in https://developers.google.com/gmail/api/quickstart/ruby.

  • Use this wizard to create or select a project in the Google Developers Console and automatically enable the API.
  • In the sidebar on the left, select Consent screen. Select an EMAIL ADDRESS and enter a PRODUCT NAME if not already set and click the Save button.
  • In the sidebar on the left, select Credentials and click Create new Client ID.
  • Select the application type Installed application, the installed application type Other, and click the Create Client ID button.
  • Click the Download JSON button under your new client ID. Move this file to your working directory and rename it client_secret.json.

The client_secret.json file does download but it is empty. The title of the file looks like it must be the client_id ending in apps.googleusercontent.com however there is no data stored inside the file.

like image 533
ElioRubens Avatar asked Jun 17 '15 14:06

ElioRubens


1 Answers

I assume this just pre-populates the json for you. If you check out API Client Library for Ruby (Alpha) - Client Secrets, you should be able to manually create it with the information on the same page that offers the "DOWNLOAD JSON" button.

Although this says it is for Ruby, I don't think the json format would be any different for other languages.

Here is a snippet of the example from the above Google Reference URL:

Here is an example client_secrets.json file for a web application:

{
  "web": {
    "client_id": "asdfjasdljfasdkjf",
    "client_secret": "1912308409123890",
    "redirect_uris": ["https://www.example.com/oauth2callback"],
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://accounts.google.com/o/oauth2/token"
  }
}

Here is an example client_secrets.json file for an installed application:

{
  "installed": {
    "client_id": "837647042410-75ifg...usercontent.com",
    "client_secret":"asdlkfjaskd",
    "redirect_uris": ["http://localhost", "urn:ietf:wg:oauth:2.0:oob"],
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://accounts.google.com/o/oauth2/token"
  }
}
like image 192
Eric Avatar answered Oct 21 '22 19:10

Eric