Google OAuth Setup

Prev Next

You can allow users to sign in to your Rocket.Chat workspace with their Google accounts. This makes logging in fast and secure.

Prerequisites

Before setting up Google OAuth, you need:

  • A project in the Google Cloud Console.

  • A consent screen. You can create one under API & Services > OAuth consent screen, then fill in the required fields.

  • OAuth credentials (Client ID and Client Secret).

    • To create them, go to Credentials > Create Credentials > OAuth client ID.

    • Choose Web application as the application type.

    • Enter the required details, including the Authorized redirect URIs shown below:

      https://YOUR DOMAIN/_oauth/google?close
      https://YOUR DOMAIN/_oauth/google

Be sure to include the ?close variant to avoid the error: Error 400: redirect_uri_mismatch.

See this reference for detailed information.

After creating the OAuth client, copy the Client ID and Client Secret (or download the JSON file). You’ll use these while configuring Google OAuth in your Rocket.Chat workspace.

Configure Google OAuth

Once you have your Client ID and Client Secret, configure Google OAuth in Rocket.Chat:

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

  2. Toggle Google Login to on.

  3. Enter your Google ID and Google Secret (from the credentials you created).

  4. Verify that the Google Callback URL matches one of the authorized redirect URIs you set in your Google project.

  5. Click Save changes.

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