> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Credentials

> Step-by-step instructions for obtaining Google Sheets OAuth 2.0 credentials.

This guide walks you through obtaining all required credentials for the Google Sheets plugin.

## Authentication Method

The Google Sheets plugin uses OAuth 2.0 authentication exclusively.

* **[`oauth_2`](/concepts/oauth)** (default) - OAuth 2.0 authentication

## OAuth 2.0 Setup

### Step 1: Create Google Cloud Project

1. Go to [Google Cloud Console](https://console.cloud.google.com/)
2. Click **Select a project** → **New Project**
3. Enter a project name and click **Create**
4. Wait for the project to be created and select it

### Step 2: Enable Google Sheets API

1. In the Google Cloud Console, go to **APIs & Services** → **Library**
2. Search for "Google Sheets API"
3. Click on **Google Sheets API**
4. Click **Enable**

### Step 3: Create OAuth 2.0 Credentials

1. Go to **APIs & Services** → **Credentials**
2. Click **Create Credentials** → **OAuth client ID**
3. If prompted, configure the OAuth consent screen:
   * Choose **External** (unless you have a Google Workspace)
   * Fill in the required information:
     * App name
     * User support email
     * Developer contact information
   * Add scopes:
     * `https://www.googleapis.com/auth/spreadsheets`
   * Add test users (for testing)
   * Click **Save and Continue** through all steps
4. Select **Web application**
5. Configure:
   * **Name**: Your application name
   * **Authorized redirect URIs**: Add your callback URL (e.g., `https://yourapp.com/auth/googlesheets/callback`)
6. Click **Create**
7. Copy the **Client ID** and **Client Secret**
8. Store these securely

**Storing Credentials:**

Store your OAuth app credentials, then start the flow:

```bash theme={null}
pnpm corsair setup --plugin=googlesheets client_id=your-client-id client_secret=your-client-secret
pnpm corsair auth --plugin=googlesheets
```

The CLI will print an authorization URL — open it in a browser. Once you approve, tokens are saved automatically.

To verify credentials were stored:

```bash theme={null}
pnpm corsair auth --plugin=googlesheets --credentials
```

## Required Credentials Summary

| Credential    | Required For | Where to Find                                        |
| ------------- | ------------ | ---------------------------------------------------- |
| Client ID     | OAuth 2.0    | Google Cloud Console → APIs & Services → Credentials |
| Client Secret | OAuth 2.0    | Google Cloud Console → APIs & Services → Credentials |
| Access Token  | OAuth 2.0    | Obtained automatically after OAuth flow              |
| Refresh Token | OAuth 2.0    | Obtained automatically after OAuth flow              |

For general information about how Corsair handles authentication, see [Authentication](/concepts/auth).
