GitLab SSO with Google Workspace (OAuth 2.0)

Connect Google Workspace to GitLab Self-Managed via Google OAuth, then test organization access, account linking and offboarding.

Last updated

On this page (5)

GitLab · Google Workspace · OAuth 2.0

Before you start

This uses GitLab’s google_oauth2 OmniAuth provider, documented for Self-Managed Free, Premium and Ultimate. It is not GitLab.com group SAML or directory provisioning.

  • GitLab Self-Managed administrator.
  • Google Cloud project owned by the Workspace organization and eligible for an Internal OAuth audience.
  • Explicit GitLab signup and existing-account linking policy.

Configure sign-in

  1. In Google Auth Platform choose an Internal audience and create a Web application OAuth client. Register the redirects listed by GitLab on its public HTTPS origin, including /users/auth/google_oauth2/callback; an HTTP URL or a hostname different from the one users visit will not match.
  2. In GitLab OmniAuth configure the google_oauth2 provider with the client ID and secret using the Linux package or Helm instructions. Decide explicitly whether omniauth_allow_single_sign_on should create a GitLab user and whether omniauth_block_auto_created_users should leave a new user pending approval. Google sign-in need not grant project access.
  3. In a pilot, link Google from an authenticated existing GitLab account using GitLab’s connected-account workflow. Verify GitLab retains the same user and external Google identity before you permit self-enrollment. Do not treat an email suffix as a substitute for an Internal OAuth audience.

Verify the result

  • A Workspace pilot reaches their existing projects while a personal Google account and a user outside the organization cannot enroll.
  • Removing Workspace access does not by itself prove GitLab sessions, PATs or SSH keys are revoked; test each and document GitLab-side offboarding.

Official documentation

Have Pilae connect your identity provider

Pilae can deploy GitLab with your identity provider already connected. We agree the edition, account mapping and access tests with your team before rollout.