Skip to content

Instantly share code, notes, and snippets.

@siddhantkushwaha
Created May 13, 2022 07:35
Show Gist options
  • Save siddhantkushwaha/42ebc0a6d3348b0f62fb4b5e769876ed to your computer and use it in GitHub Desktop.
Save siddhantkushwaha/42ebc0a6d3348b0f62fb4b5e769876ed to your computer and use it in GitHub Desktop.
Steps to build credentials JSON for Google APIS.

Follow these steps to build credentials JSON

  1. Go to https://console.cloud.google.com/projectcreate.
  2. Fill in Project Name, like "Sample-Project" or so, leave Location unchanged.
  3. Change Project ID (optional).
  4. Click "CREATE".
  5. Wait a couple of seconds until the project is created and open it (click "VIEW").
  6. On the APIs pane, click "Go to APIs overview".
  7. Click "ENABLE APIS AND SERVICES".
  8. Search for the API you need to enable.
    • For Google Drive, enter "Drive", select "Google Drive API".
    • For GMail, enter "GMail", select "GMail API".
  9. Click "ENABLE".
  10. Go to "Credentials" menu in the left menu bar.
  11. Click "CONFIGURE CONSENT SCREEN".
  12. Choose "External", click "CREATE".
  13. Fill in something like "Sample-Project" in the "Application name" box.
  14. At the bottom click "Save".
  15. Go to "Credentials" menu in the left menu bar (again).
  16. Click "CREATE CREDENTIALS".
  17. Select "OAuth client ID".
  18. Select "Desktop app" as "Application type".
  19. Change the name (optional).
  20. Click "Create".
  21. Click "OK" in the "OAuth client created" dialog.
  22. In the "OAuth 2.0 Client IDs" section click on the just create Desktop app line.
  23. In the top bar, click "DOWNLOAD JSON".
  24. You will get a file like "client_secret_xxxxxx.apps.googleusercontent.com.json".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment