GitHub OAuth Setup

Prev Next

You can allow users to sign in to your Rocket.Chat workspace using their GitHub or GitHub Enterprise accounts.

Prerequisites

Before setting up GitHub OAuth, you need:

  • A GitHub or GitHub Enterprise account.

  • A GitHub OAuth app with a Client ID and Client Secret.

    • If you don’t have an app, go to GitHub Developer Settings, then OAuth Apps > New OAuth App.

    • Fill in the required information, including the Authorization callback URL, and save the app.

    • After the app is created, GitHub will display your Client ID and provide a button to generate a Client Secret. Copy both values.

Important

  • Retrieve the Authorization Callback URL from Rocket.Chat under GitHub Callback URL and add it when creating your GitHub app.

  • If the callback URL does not match, GitHub won’t show an error. Instead, login will fail with this error: No matching login attempt found.

Configure GitHub OAuth

Once you have your GitHub OAuth app credentials, configure GitHub OAuth in Rocket.Chat:

  1. In your Rocket.Chat workspace, go to Administration > Workspace > Settings > OAuth and expand the GitHub section.

  2. Toggle OAuth Enabled to on.

  3. Enter the following values:

    • Client Id: Enter the Client ID provided in your GitHub OAuth app.

    • Client Secret: Enter the Client Secret generated in your GitHub OAuth app.

    • GitHub Callback URL: Copy this URL from Rocket.Chat and paste it into your GitHub app settings.

    • Server URL (GitHub Enterprise only): Enter the base URL of your GitHub Enterprise instance.

  4. Click Save changes.

After saving, a Sign in with GitHub button will appear on your workspace login page. Users can now log in with their GitHub accounts.