You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow these steps to create and configure your OAuth credentials for using Google APIs.
4
+
5
+
## 1. Create API Credentials
6
+
7
+
1. Go to the [Google API Console](https://console.developers.google.com/).
8
+
2. From the projects list, select an existing project or create a new one.
9
+
3. In the left side menu, select **APIs & Services**.
10
+
4. On the left menu, click **Credentials**.
11
+
5. Click **Create Credentials** and select **OAuth client ID**.
12
+
6. In the **Application type** section, select **Desktop app**.
13
+
7. Provide an appropriate name for your client ID (e.g., "Gspread OAuth Client").
14
+
8. Click **Create**.
15
+
16
+
Once the credential is created, you will receive a **Client ID** and **Client Secret**. These are required for accessing the API.
17
+
18
+
## 2. Store Your Credentials
19
+
20
+
Save the **Client ID** and **Client Secret** in a `.env` within a `.secret` directory. The file should look like this:
21
+
22
+
```bash
23
+
CLIENT_ID=YOUR_CLIENT_ID
24
+
CLIENT_SECRET=YOUR_SECRET_KEY
25
+
```
26
+
27
+
28
+
# Troubleshooting
29
+
30
+
If you encounter problems with authentication or tokens, you will most likely need to add **AUTH_URI** or **TOKEN_URI** to the .env file. To retrieve them, download the API key you created in JSON format. Open the file and copy the keys into the .env file. After making these changes, your .env file should look like this:
31
+
32
+
```bash
33
+
CLIENT_ID=YOUR_CLIENT_ID
34
+
CLIENT_SECRET=YOUR_SECRET_KEY
35
+
AUTH_URI=YOUR_AUTH_URI
36
+
TOKEN_URI=YOUR_TOKEN_URI
37
+
```
38
+
39
+
If you still get some issues, follow [Google OAuth Documentation](https://developers.google.com/identity/protocols/oauth2/).
0 commit comments