Skip to main content
This guide walks you through configuring GitHub OAuth for your app’s authentication. Your app’s users will be able to sign in with their GitHub accounts.

Prerequisites

  • A published Replit app (you need a deployment URL like your-app.replit.app)
  • A GitHub account

Step 1: Publish your app

Before configuring custom OAuth credentials, you need a published deployment URL. You’ll need the URL when setting up your custom GitHub credentials.
  1. Publish your app from the Replit workspace
  2. Note your published URL (e.g., https://your-app.replit.app)

Step 2: Create a GitHub OAuth app

  1. Navigate to GitHub Developer Settings
  2. Select OAuth Apps in sidebar
  3. Select New OAuth App
  4. Fill in the application details:
Application name: Enter a name for your application. Homepage URL: Enter your published app URL:
https://your-app.replit.app
Authorization callback URL: The callback URL is your published domain followed by /__clerk/v1/oauth_callback. Enter the following, replacing your-app.replit.app with your actual published domain:
https://your-app.replit.app/__clerk/v1/oauth_callback
  1. Select Register application

Step 3: Generate client credentials

  1. You’ll see your Client ID on the app’s settings page - copy it
  2. Select Generate a new client secret
  3. Copy your Client Secret immediately
Save your Client Secret securely. You can’t view it again after leaving the page. If lost, you’ll need to generate a new one.

Step 4: Enter credentials in Replit

  1. In your Repl, navigate to the Auth pane
  2. Select the Configure tab
  3. Select Production environment
  4. Select the Edit button next to GitHub
  5. Toggle on Use custom credentials
  6. Paste your Client ID and Client Secret
  7. Select Save changes
  8. Toggle GitHub to Enabled

Step 5: Test your integration

  1. Open your published app’s login page
  2. Select Sign in with GitHub
  3. Authorize the app on GitHub
  4. Verify successful authentication

Troubleshooting

Redirect URI mismatch

  • Verify the Authorization callback URL is exactly https://your-app.replit.app/__clerk/v1/oauth_callback
  • Check for typos or incorrect protocols
  • No trailing slashes

Invalid client

  • Double-check Client ID and Client Secret are copied correctly
  • Ensure no extra spaces when pasting

Not working on custom domain

  • Update the Homepage URL in your GitHub OAuth app to your custom domain
  • Update the Authorization callback URL to https://your-custom-domain.com/__clerk/v1/oauth_callback
  • Republish your app