-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: hardcode temporary secret; update documentation
- Loading branch information
Showing
3 changed files
with
90 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,55 +69,14 @@ List events | |
gcal list | ||
``` | ||
|
||
## Google Calendar API Authentication with OAuth2 | ||
|
||
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. | ||
|
||
### Step 1: Create a New Project | ||
1. Go to the [Google Developer Console](https://console.developers.google.com/). | ||
2. Click on the **Create Project** button. | ||
3. Enter a name for your project and click **Create**. | ||
|
||
### Step 2: Enable the Google Calendar API | ||
1. In the [Google Developer Console](https://console.developers.google.com/), navigate to the **Library** section. | ||
2. Search for "Google Calendar API". | ||
3. Click on the **Google Calendar API** and then click **Enable**. | ||
|
||
### Step 3: Create OAuth2 Consent Screen | ||
1. In the [Google Developer Console](https://console.developers.google.com/), navigate to the **OAuth consent screen** section. | ||
2. Choose **External** as the user type and click **Create**. | ||
3. Fill out the required app information: | ||
- **App name**: `gcalcli` | ||
- **User support email**: `[email protected]` | ||
4. Fill out the required developer contact information: | ||
- **Email addresses**: `[email protected]` | ||
5. Click **Save and continue**. | ||
6. Under **Scopes**, click **Save and continue**. | ||
7. Under **Test users**, add your email (`[email protected]`). | ||
8. Click **Save and continue**. | ||
|
||
### Step 4: Create OAuth Client ID | ||
1. In the [Google Developer Console](https://console.developers.google.com/), navigate to the **Credentials** section. | ||
2. Click **Create credentials** and select **OAuth client ID**. | ||
3. Select **Application type: Desktop app**. | ||
4. Click **Create**. | ||
5. Download the JSON file containing your client ID and secret. | ||
|
||
### Step 5: Configure gcalcli | ||
1. Create a directory for gcalcli configuration: | ||
```sh | ||
mkdir -p ~/.gcal | ||
``` | ||
2. Place the downloaded JSON file into the `~/.gcal` directory: | ||
```sh | ||
mv /path/to/your/downloaded/secret.json ~/.gcal/secret.json | ||
``` | ||
|
||
### Step 6: Authenticate with Google | ||
|
||
## Authentication | ||
|
||
By default, a hardcoded and unverified Google secret is included in the project. This secret has a user cap limit and can be used temporarily. If you want to use your custom authentication (via Google Console), you can find step-by-step instructions [here](docs/custom_auth.md). | ||
|
||
How it works in the background ? | ||
|
||
1. Start gcalcli. The authentication process will begin automatically. | ||
2. Follow the instructions to complete the authentication process. | ||
|
||
The resulting token will be stored in the `~/.gcal/store.json` file. | ||
|
||
By following these steps, you will have successfully set up OAuth2 authentication for your Google Calendar API using gcalcli. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
## Google Calendar API Authentication with OAuth2 | ||
|
||
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. | ||
|
||
### Step 1: Create a New Project | ||
1. Go to the [Google Developer Console](https://console.developers.google.com/). | ||
2. Click on the **Create Project** button. | ||
3. Enter a name for your project and click **Create**. | ||
|
||
### Step 2: Enable the Google Calendar API | ||
1. In the [Google Developer Console](https://console.developers.google.com/), navigate to the **Library** section. | ||
2. Search for "Google Calendar API". | ||
3. Click on the **Google Calendar API** and then click **Enable**. | ||
|
||
### Step 3: Create OAuth2 Consent Screen | ||
1. In the [Google Developer Console](https://console.developers.google.com/), navigate to the **OAuth consent screen** section. | ||
2. Choose **External** as the user type and click **Create**. | ||
3. Fill out the required app information: | ||
- **App name**: `gcalcli` | ||
- **User support email**: `[email protected]` | ||
4. Fill out the required developer contact information: | ||
- **Email addresses**: `[email protected]` | ||
5. Click **Save and continue**. | ||
6. Under **Scopes**, click **Save and continue**. | ||
7. Under **Test users**, add your email (`[email protected]`). | ||
8. Click **Save and continue**. | ||
|
||
### Step 4: Create OAuth Client ID | ||
1. In the [Google Developer Console](https://console.developers.google.com/), navigate to the **Credentials** section. | ||
2. Click **Create credentials** and select **OAuth client ID**. | ||
3. Select **Application type: Desktop app**. | ||
4. Click **Create**. | ||
5. Download the JSON file containing your client ID and secret. | ||
|
||
### Step 5: Configure gcalcli | ||
1. Create a directory for gcalcli configuration: | ||
```sh | ||
mkdir -p ~/.gcal | ||
``` | ||
2. Place the downloaded JSON file into the `~/.gcal` directory: | ||
```sh | ||
mv /path/to/your/downloaded/secret.json ~/.gcal/secret.json | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters