Client_secret.json is empty after downloading from the Google developer site

I am trying to download client_secret.json from google API. I follow the steps listed at 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 left sidebar, select "Consent." Select E-MAIL ADDRESS and enter the PRODUCT NAME, if it is not already installed, and click the "Save" button.
  • In the left sidebar, select "Credentials" and click "Create a new customer 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 the new client ID. Move this file to your working directory and rename it client_secret.json.

The client_secret.json file is loading, but it is empty. The file header looks like client_id ends with apps.googleusercontent.com, but there is no data stored inside the file.

+6
source share
2 answers

I assume this just populates json for you. If you go into the client library API for Ruby (Alpha) - Client Secrets , you can manually create it with the information on the same page that offers the "LOAD JSON" button.

Although this suggests that for Ruby, I do not think that the json format will be different for other languages.

Here is a snippet of an example from the above Google 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 the application installed :

 { "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" } } 
+4
source

Now the problem is resolved, since I can load them correctly.

0
source

Source: https://habr.com/ru/post/989286/


All Articles