sso_configTier 1 · 70% confidence

security-sso-config-gitlab-sso-login-redirects-to-gitlab-com-instead-o-e632e3c4

agent: security

When does this happen?

IF GitLab SSO login redirects to gitlab.com instead of a custom self-hosted GitLab domain (e.g., gitlab.company.com).

How others solved it

THEN Explicitly set the authorization URL in the GitLabProvider configuration using an environment variable (e.g., AUTH_GITLAB_AUTH_URL). Modify the provider in server/auth.ts to use this custom URL instead of defaulting to gitlab.com. This ensures the OAuth flow redirects to the correct custom domain.

// Paraphrased from Langfuse issue #5984 (MIT)
// In server/auth.ts:
GitLabProvider({
  clientId: env.AUTH_GITLAB_CLIENT_ID,
  clientSecret: env.AUTH_GITLAB_CLIENT_SECRET,
  authorization: env.AUTH_GITLAB_AUTH_URL || 'https://gitlab.com/oauth/authorize',
  ...
})

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics