Getting credentials from GCP (Google Cloud Platform)

Getting credentials from GCP (Google Cloud Platform)

This blog focuses on the main aspects of how to get credentials to deal with different APIs like Sheets, Calendar, etc. The process remains almost the same. The only changes are in choosing the platform and the required scopes. So feel free to do appropriate modifications as per your application requirements. Follow the steps to stay in the loop and get the result as expected.

Steps to get credentials from GCP

  1. Head to http://console.cloud.google.com and click on the drop-down and select `New Project`.

  2. Give a unique name to create a new free cloud project

    It takes some time to allocate the resources for the project. So make sure to wait for some time until the project is established successfully.

  3. On the left panel click on API & Services tab and enable Google Calendar API.

    Make sure that it has API Enabled and has a green tick.

  4. Click on Manage, then navigate to Credentials on the left pane and create a select Create Credentials -> OAuth Client ID. Follow Step-4 in this guide for further reference. If you are prompted to Configure the consent screen then follow these steps:

    • Choose the User type as External :

    • Then fill in the mandatory fields like App name, User support email, and Email addresses are at the bottom.

      Then click on SAVE AND CONTINUE and move to the next step.

    • Then click on Add or remove scopes and select the correct scope for this we shall require Google Calendar /auth/calendar scope. If they are different feel free to choose the one's according to your project. Also, they can be modified even after they are created.

      Then select Update button.

    • Then click on Save and continue until you reach Back to dashboard. Then proceed with steps ahead.

  5. Click Application type -> Desktop app. In the name field, make sure to give it a unique name.

  6. Click Create. The OAuth client-created screen appears, showing your new Client ID and Client secret.

  7. Save the downloaded JSON file as secrets.json. It should like something similar (not the same actually)๐Ÿ‘‡

  8. Then download the .json file generated and use them in your application wherever required.

Thanks for staying till the end. Hope you like the blog. Up for comments and suggestions. Feel free to click on โค๏ธ if you liked reading the blog.

ย