Skip to main content
This guide walks you through obtaining all required credentials for the YouTube plugin.

Authentication Method

The YouTube plugin uses OAuth 2.0 authentication exclusively.
  • oauth_2 (default) — OAuth 2.0 for the YouTube Data API v3
The steps match other Google integrations (Gmail, Google Calendar, Drive, and Sheets): you create an OAuth client in Google Cloud, enable the YouTube Data API v3, add redirect URIs, then store client_id and client_secret and run the Corsair auth flow. You can use the same Google Cloud project as your other Google OAuth apps if you add the YouTube API and the right scopes to the consent screen.

OAuth 2.0 Setup

Step 1: Create or select a Google Cloud project

  1. Go to Google Cloud Console.
  2. Create a new project or select an existing one (the same project you use for Gmail/Drive/Calendar is fine if you prefer one OAuth app for all Google services).

Step 2: Enable YouTube Data API v3

  1. Open APIs & ServicesLibrary.
  2. Search for YouTube Data API v3.
  3. Open it and click Enable.
  1. Go to APIs & ServicesOAuth consent screen.
  2. Choose External (or Internal for Workspace-only apps) and complete the required fields.
  3. On Scopes, add the YouTube scopes your app needs. Examples (add only what you use):
    • https://www.googleapis.com/auth/youtube.readonly — read-only access to channel and video metadata the API allows.
    • https://www.googleapis.com/auth/youtube — manage your YouTube account (upload, edit, etc.; broad).
    • https://www.googleapis.com/auth/youtube.force-ssl — account access over HTTPS (often used with full channel management).
Refer to YouTube Data API authorization scopes for the full list.

Step 4: Create OAuth 2.0 credentials

  1. Go to APIs & ServicesCredentials.
  2. Click Create credentialsOAuth client ID.
  3. Choose Web application (or the client type Corsair expects for your deployment).
  4. Under Authorized redirect URIs, add the callback URL your app uses for YouTube OAuth (the same pattern as Gmail or Calendar — e.g. https://yourapp.com/auth/youtube/callback or whatever you configured in Corsair).
  5. Create the client and copy the Client ID and Client secret.
Storing credentials and authorizing:
pnpm corsair setup --plugin=youtube client_id=your-client-id client_secret=your-client-secret
pnpm corsair auth --plugin=youtube
Open the authorization URL from the CLI, sign in with Google, and approve access. Tokens are stored for Corsair to use. Verify:
pnpm corsair auth --plugin=youtube --credentials

Required Credentials Summary

CredentialRequired forWhere to find
Client IDoauth_2Google Cloud Console → APIs & Services → Credentials
Client secretoauth_2Same page
Access / refresh tokensAfter OAuthIssued when you complete pnpm corsair auth --plugin=youtube
For general information about how Corsair handles authentication, see Authentication. For Google OAuth setup shared across products, you can also align with Gmail Get Credentials and Google Calendar Get Credentials — the Cloud project and OAuth client pattern is the same; only the enabled API and scopes differ.