Skip to main content

Google OAuth Authentication

Allow users to sign in with their Google accounts for a seamless authentication experience. Google OAuth provides social login integration with zero password management overhead.

Features

  • ✅ One-click social login
  • ✅ No password management required
  • ✅ Automatic user profile information
  • ✅ Works alongside email/password authentication
  • ⚠️ Requires Google Cloud setup

Required Environment Variables

GOOGLE_CLIENT_ID=your_google_client_id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your_google_client_secret

Setup Guide

1. Create Google OAuth Credentials

  1. Go to Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the Google+ API
  4. Navigate to CredentialsCreate CredentialsOAuth client ID
  5. Choose Web application

2. Configure Authorized Redirect URIs

Add the following redirect URIs to your OAuth client: For Development:
http://localhost:3000/auth/google/callback
For Production:
https://your-domain.com/auth/google/callback
The redirect URI must match exactly, including protocol (http/https) and port. Trailing slashes matter!

3. Get Your Credentials

  1. After creating the OAuth client, you’ll see a modal with your credentials
  2. Copy the Client ID (ends with .apps.googleusercontent.com)
  3. Copy the Client Secret (starts with GOCSPX-)
  4. Store these securely - never commit them to version control

4. Configure Environment Variables

export GOOGLE_CLIENT_ID=123456789-abcdefg.apps.googleusercontent.com
export GOOGLE_CLIENT_SECRET=GOCSPX-your_client_secret_here

5. Start Oxy in Cloud Mode

oxy serve --cloud  # authentication is not supported in local mode