Skip to main content

OAuth Setup

The Agent Starter Kit comes with Google and GitHub OAuth 2.0 preconfigured.

To enable these providers, you must define the following environment variables in your .env file:

GOOGLE_CLIENT_ID='FILL_IT_WITH_YOUR_VALUE'
GOOGLE_CLIENT_SECRET='FILL_IT_WITH_YOUR_VALUE'
GOOGLE_REDIRECT_URI=/auth/google/callback

GITHUB_CLIENT_ID='FILL_IT_WITH_YOUR_VALUE'
GITHUB_CLIENT_SECRET='FILL_IT_WITH_YOUR_VALUE'
GITHUB_REDIRECT_URI=/auth/github/callback

How to setup

Google OAuth 2.0 in GCP

  1. Link: https://console.cloud.google.com/apis/credentials

  2. Type + Credentials : Create OAuth client ID

  3. No need for: Authorized JavaScript origins

  4. Authorized redirect URIs: http://localhost:8888/auth/google/callback for local development , http://projectdomain.com/auth/google/callback for production

  5. Configure branding and provide a Privacy Policy URL.

  6. Initially, the OAuth client will be in test mode. In this mode:

    • You must explicitly add test user email addresses.
    • Only these test users will be able to sign in using SSO.

    When you are ready for production, publish the OAuth client.
    Don't worry, this process is straightforward and easy to do.

Github OAuth 2.0

  1. Create a new free organization
  2. Go to Settings
  3. Go to Developer Settings at the bottom
  4. Press OAuth Apps + Create one
  5. Don't need Enable Device Flow. Because it needed only for CLI's and GCM
  6. Create new secret