This guide will help you set up OAuth2 authentication for your Google Calendar API. Follow these steps to create a project, enable the API, and obtain the necessary credentials.
- Go to the Google Developer Console.
- Click on the Create Project button.
- Enter a name for your project and click Create.
- In the Google Developer Console, navigate to the Library section.
- Search for "Google Calendar API".
- Click on the Google Calendar API and then click Enable.
- In the Google Developer Console, navigate to the OAuth consent screen section.
- Choose External as the user type and click Create.
- Fill out the required app information:
- App name:
gcalcli
- User support email:
[email protected]
- App name:
- Fill out the required developer contact information:
- Email addresses:
[email protected]
- Email addresses:
- Click Save and continue.
- Under Scopes, click Save and continue.
- Under Test users, add your email (
[email protected]
). - Click Save and continue.
- In the Google Developer Console, navigate to the Credentials section.
- Click Create credentials and select OAuth client ID.
- Select Application type: Desktop app.
- Click Create.
- Download the JSON file containing your client ID and secret.
- Create a directory for gcalcli configuration:
mkdir -p ~/.gcal
- Place the downloaded JSON file into the
~/.gcal
directory:mv /path/to/your/downloaded/secret.json ~/.gcal/secret.json