Skip to content

Google Calendar authorization

Abhijeet Rastogi edited this page Oct 24, 2023 · 21 revisions

Web

  1. Login to console.cloud.google.com

  2. Visit with the right logged-in user

https://console.cloud.google.com/getting-started?authuser=2

  1. Create new project or use existing project.

https://console.cloud.google.com/projectcreate?authuser=2

image

image

  1. Navigate to "Google Calendar API" page and "Enable it"
  • Search "google calendar api" and choose "Google Calendar API"

image

5 Enable Google Calendar API.

image

  1. Create credentials.json
  • Create Oauth Application

image

  • Configure OAuth Consent Screen
    • Choose External
    • Add your email ID as "Testing users", otherwise you'll get the "App unverified error" while getting the token.
    • For scopes, leave everything empty.
image
  1. Create oauth client

image

Download JSON, rename it to credentials.json and move to ~/.config/calsync/credentials.json.

image

CLI (incomplete)

  • Install gcloud cli:-
➤ brew install --cask google-cloud-sdk
  • Login, create new project:-
➤ gcloud init
  • Create new project, make sure its unique, I added my suffix to make sure its unique.
➤ gcloud projects create calsync-shadyabhi
  • Select project
➤ gcloud config set project calsync-shadyabhi
Updated property [core/project].
  • Enable Google Calendar
➤ gcloud services enable calendar-json.googleapis.com
Operation "operations/acat.p2-582178116564-5d220b48-62d8-493b-b547-eef961491467" finished successfully.
  • Create service account, provide right permissions.
➤ gcloud iam service-accounts create calsync-sa
Created service account [calsync-sa].

➤ gcloud projects add-iam-policy-binding calsync-shadyabhi --member="serviceAccount:[email protected]" --role="roles/owner"
Clone this wiki locally