OAuth Setup
Configure GitHub and Google OAuth for team authentication.
GitHub OAuth
Step 1: Create a GitHub OAuth App
- Go to GitHub Settings → Developer settings → OAuth Apps
- Click "New OAuth App"
- Fill in the details:
- Application name: Kubey (or your preferred name)
- Homepage URL:
https://your-kubey-domain.com - Authorization callback URL:
https://your-kubey-domain.com/auth/callback/github
- Click "Register application"
- Copy the Client ID
- Click "Generate a new client secret" and copy it
Step 2: Configure Kubey
Add the credentials to your environment:
GITHUB_CLIENT_ID=your_client_id_here
GITHUB_CLIENT_SECRET=your_client_secret_hereImportant: For local development, use http://localhost:8080/auth/callback/github as the callback URL.
Google OAuth
Step 1: Create Google OAuth Credentials
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Navigate to APIs & Services → Credentials
- Click "Create Credentials" → "OAuth client ID"
- If prompted, configure the OAuth consent screen first:
- User Type: External (or Internal for Google Workspace)
- App name: Kubey
- Support email: your email
- Scopes: email, profile, openid
- For the OAuth client ID:
- Application type: Web application
- Name: Kubey
- Authorized JavaScript origins:
https://your-kubey-domain.com - Authorized redirect URIs:
https://your-kubey-domain.com/auth/callback/google
- Click "Create" and copy the Client ID and Client Secret
Step 2: Configure Kubey
GOOGLE_CLIENT_ID=your_client_id_here.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your_client_secret_hereComplete Configuration Example
Here's a complete example with both providers configured:
.envbash
# Authentication mode
AUTH_MODE=shared
# Database (required for shared mode)
DATABASE_URL=postgres://kubey:kubey@localhost:5432/kubey?sslmode=disable
# Security
JWT_SECRET=your-jwt-secret-min-32-chars
ENCRYPTION_KEY=your-encryption-key-min-32-chars
# GitHub OAuth
GITHUB_CLIENT_ID=Iv1.xxxxxxxxxxxxxxxx
GITHUB_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Google OAuth
GOOGLE_CLIENT_ID=xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxxxxxxxxxxxDomain Restrictions
You can restrict sign-ups to specific email domains through the Admin Panel:
- Log in as an admin user
- Go to Admin → Settings
- Add allowed domains (e.g.,
yourcompany.com) - Optionally enable "Invite Only" mode
Tip: When domain restrictions are enabled, users with emails outside the allowed domains will see an error when trying to sign up, even if they successfully authenticate with GitHub/Google.
First-Time Setup
When you first deploy Kubey with AUTH_MODE=shared, you'll see a setup page to create the first admin user. This user will have full access to manage other users and settings.