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
- 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. - In GitLab OmniAuth configure the
google_oauth2provider with the client ID and secret using the Linux package or Helm instructions. Decide explicitly whetheromniauth_allow_single_sign_onshould create a GitLab user and whetheromniauth_block_auto_created_usersshould leave a new user pending approval. Google sign-in need not grant project access. - 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.
