> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coderabbit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Prepare self-hosted Git providers for SSO

> Update the CodeRabbit OAuth application on GitHub Enterprise Server or GitLab Self-Managed before onboarding the provider to an Enterprise SSO workspace.

export const EnterprisePlanBadge = ({tip = "This feature is available exclusively as part of the Enterprise plan. Please refer to our pricing page for more information about our plans and features.", title = "Enterprise Plan", cta = "Read more", href = "https://coderabbit.ai/pricing", disabled = false}) => {
  return <Tooltip tip={tip} cta={cta} href={href}>
        <Badge icon="building-2" disabled={disabled || undefined}>
            {title}
        </Badge>
    </Tooltip>;
};

export const AdminRoleBadge = ({tip = "This feature requires an organization owner, an admin role or the corresponding permission. Regular Members do not have access.", title = "Admin Only", cta = "View roles", href = "/management/roles", disabled = false}) => {
  return <Tooltip tip={tip} cta={cta} href={href}>
        <Badge icon="lock" color="orange" disabled={disabled || undefined}>
            {title}
        </Badge>
    </Tooltip>;
};

<EnterprisePlanBadge />

<AdminRoleBadge tip="This setup requires administrative access to the CodeRabbit OAuth application on the self-hosted Git provider." />

When you add a self-hosted Git provider to a CodeRabbit Enterprise SSO workspace, update the existing CodeRabbit OAuth application on that Git provider before starting the SSO onboarding process. This allows the OAuth application to return users to the CodeRabbit workspace onboarding flow.

This preparation is required for GitHub Enterprise Server and GitLab Self-Managed. It is not required for GitHub Cloud or GitLab.com.

Before starting, give your CodeRabbit account team:

* The base URL of each self-hosted Git provider instance
* The Git organizations or groups that you want to add to the SSO workspace
* Confirmation that the callback or redirect URI change described below is complete

## GitHub Enterprise Server

For GitHub Enterprise Server, replace the CodeRabbit OAuth application's authorization callback URL with the CodeRabbit application URL.

<Steps>
  <Step title="Open the CodeRabbit OAuth application">
    Sign in to GitHub Enterprise Server as an administrator who can manage the CodeRabbit OAuth application.

    Open:

    ```text theme={null}
    https://<github-host>/settings/applications/<app-id>
    ```
  </Step>

  <Step title="Update the authorization callback URL">
    Set **Authorization callback URL** to:

    ```text theme={null}
    https://app.coderabbit.ai/
    ```

    <Frame caption="Set the GitHub Enterprise Server authorization callback URL to the CodeRabbit application URL">
      <img src="https://mintcdn.com/coderabbit/Y952ePM0ScQYBZB9/assets/images/sso-self-hosted-github-oauth-callback.png?fit=max&auto=format&n=Y952ePM0ScQYBZB9&q=85&s=c03b00748b8fabe28bea4fd825e09990" alt="GitHub OAuth application settings showing https://app.coderabbit.ai as the authorization callback URL" width="1276" height="982" data-path="assets/images/sso-self-hosted-github-oauth-callback.png" />
    </Frame>
  </Step>

  <Step title="Save the application">
    Save the OAuth application and confirm the callback URL still shows `https://app.coderabbit.ai/`.
  </Step>
</Steps>

## GitLab Self-Managed

For GitLab Self-Managed, add the CodeRabbit SSO onboarding callback as an additional redirect URI. Preserve the application's existing redirect URI entries.

<Steps>
  <Step title="Open instance OAuth applications">
    Sign in to GitLab Self-Managed as an administrator and open:

    ```text theme={null}
    https://<gitlab-host>/admin/applications
    ```
  </Step>

  <Step title="Edit the CodeRabbit application">
    Find the authorized CodeRabbit application and select **Edit**.

    <Frame caption="Find the CodeRabbit instance OAuth application and select Edit">
      <img src="https://mintcdn.com/coderabbit/Y952ePM0ScQYBZB9/assets/images/sso-self-hosted-gitlab-application-list.png?fit=max&auto=format&n=Y952ePM0ScQYBZB9&q=85&s=9379f07fa93a3cc7ec0ab779b8c6d6e4" alt="GitLab instance OAuth applications list with the edit action highlighted for the CodeRabbit application" width="2454" height="368" data-path="assets/images/sso-self-hosted-gitlab-application-list.png" />
    </Frame>
  </Step>

  <Step title="Add the SSO onboarding redirect URI">
    In **Redirect URI**, start a new line and add:

    ```text theme={null}
    https://app.coderabbit.ai/sso/onboarding/oauth-callback
    ```

    Do not replace the existing CodeRabbit login redirect URI. GitLab accepts one redirect URI per line.

    <Frame caption="Add the SSO onboarding callback on a separate line in the Redirect URI field">
      <img src="https://mintcdn.com/coderabbit/Y952ePM0ScQYBZB9/assets/images/sso-self-hosted-gitlab-redirect-uri.png?fit=max&auto=format&n=Y952ePM0ScQYBZB9&q=85&s=8632628347ce28c3a777feb229ff5584" alt="GitLab OAuth application Redirect URI field showing two redirect URIs on separate lines" width="2536" height="252" data-path="assets/images/sso-self-hosted-gitlab-redirect-uri.png" />
    </Frame>

    <Info>
      The screenshot shows temporary test-environment URLs. Use the production CodeRabbit callback URL shown above.
    </Info>
  </Step>

  <Step title="Save and verify the application">
    Save the application, reopen it, and confirm that both the existing login redirect URI and the new SSO onboarding callback are present.
  </Step>
</Steps>

## What's next

<CardGroup cols={1}>
  <Card title="Enterprise SSO overview" href="/management/sso" icon="key" horizontal>
    Continue with the SSO rollout checklist and select the setup guide for your identity provider.
  </Card>

  <Card title="SCIM directory sync" href="/management/sso/scim" icon="users" horizontal>
    Provision and deprovision workspace members automatically after SAML SSO is active.
  </Card>

  <Card title="Support" href="/support" icon="message-circle" horizontal>
    Contact CodeRabbit if you cannot locate the OAuth application or need help validating the callback configuration.
  </Card>
</CardGroup>
