> ## 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.

# Custom SAML SSO setup

> Configure SAML-based single sign-on between a custom identity provider and CodeRabbit from your organization's account management page.

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 page requires organization admin access. Members do not have access to Enterprise SSO settings." />

Use this guide to configure a SAML 2.0 identity provider that is not covered by a provider-specific CodeRabbit guide. The account management SSO wizard provides the CodeRabbit service provider values, expected SAML attributes, metadata configuration step, test flow, and activation step.

After SSO is activated, users with a verified email domain must sign in to CodeRabbit through your identity provider.

## Before you start

Make sure you have:

* **Critical: You must have an invitation to your CodeRabbit organization from your CodeRabbit account team before starting this setup.**
* Organization admin access in the CodeRabbit account management page
* Administrator access to your identity provider
* Permission to create and configure SAML 2.0 applications in your identity provider
* Access to your DNS provider if your email domain still needs verification
* The users, groups, or organizational units that should be allowed to sign in through SSO

<Info>
  If you do not see the **Security** section or the **Start configuration** button in your organization profile, contact your CodeRabbit account team. Your organization must be prepared for self-serve SSO before the account management SSO wizard appears.
</Info>

## Set up Custom SAML self-serve SSO

<Steps>
  <Step title="Open the account management SSO wizard">
    Accept your CodeRabbit organization invitation and sign in to the account management page. Open the organization switcher, find the invited organization, and click **Manage**.

    In the organization profile, select **Security**, and click **Start configuration**.

    <Frame caption="Start SSO configuration from the Security section">
      <img src="https://mintcdn.com/coderabbit/GloY4hCsgvrKMG0G/assets/images/custom-self-serve-security-start.png?fit=max&auto=format&n=GloY4hCsgvrKMG0G&q=85&s=5dd439c78bca1b45119849c04c5d480c" alt="Organization profile Security section with the Start configuration button highlighted" width="1754" height="900" data-path="assets/images/custom-self-serve-security-start.png" />
    </Frame>
  </Step>

  <Step title="Add and verify your email domain">
    In **Domains**, enter the email domain that should use your identity provider for CodeRabbit sign-in, then click **Add**.

    If the wizard asks you to add a DNS record, add the generated `TXT` record in your DNS provider and wait for the domain to show **Verified** before continuing.

    <Frame caption="Continue after the email domain shows Verified">
      <img src="https://mintcdn.com/coderabbit/GloY4hCsgvrKMG0G/assets/images/custom-self-serve-domain-verified.png?fit=max&auto=format&n=GloY4hCsgvrKMG0G&q=85&s=e68bb387325786f02a91c80fa3ab701c" alt="Domain verification step showing the email domain verified and redacted" width="1762" height="1060" data-path="assets/images/custom-self-serve-domain-verified.png" />
    </Frame>
  </Step>

  <Step title="Select Custom SAML Provider">
    In **Connection**, select **Custom SAML Provider** as the identity provider.

    <Frame caption="Select Custom SAML Provider as the identity provider">
      <img src="https://mintcdn.com/coderabbit/GloY4hCsgvrKMG0G/assets/images/custom-self-serve-select-provider.png?fit=max&auto=format&n=GloY4hCsgvrKMG0G&q=85&s=6dc4c958c7078238d5ed91b697bada28" alt="Identity provider selection screen with the Custom SAML Provider tile highlighted" width="1754" height="1120" data-path="assets/images/custom-self-serve-select-provider.png" />
    </Frame>
  </Step>

  <Step title="Create a SAML app in your identity provider">
    In your identity provider, create a new SAML 2.0 application for CodeRabbit. Use a clear app name such as `CodeRabbit`.

    Copy the CodeRabbit service provider values from the account management SSO wizard into the matching fields in your identity provider:

    | Identity provider field                                                   | Value                                                                                    |
    | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
    | Assertion consumer service URL, ACS URL, single sign-on URL, or reply URL | Copy the **Assertion consumer service (ACS) URL** from the account management SSO wizard |
    | Entity ID, audience URI, or SP Entity ID                                  | Copy the **Entity ID** from the account management SSO wizard                            |
    | Name ID or subject                                                        | Use the user's primary email address if your identity provider requires this field       |

    <Frame caption="Copy the service provider values into your SAML application">
      <img src="https://mintcdn.com/coderabbit/GloY4hCsgvrKMG0G/assets/images/custom-self-serve-sp-values.png?fit=max&auto=format&n=GloY4hCsgvrKMG0G&q=85&s=d2c78cee19946a18072e2123a911dc3d" alt="Account management SSO wizard showing the ACS URL and Entity ID fields redacted" width="1752" height="1060" data-path="assets/images/custom-self-serve-sp-values.png" />
    </Frame>
  </Step>

  <Step title="Map SAML attributes">
    Configure your identity provider so the SAML response includes the attributes CodeRabbit expects. Attribute names are case-sensitive.

    | Attribute name | User attribute |
    | -------------- | -------------- |
    | `mail`         | Primary email  |
    | `firstName`    | First name     |
    | `lastName`     | Last name      |

    The `mail` attribute is required. `firstName` and `lastName` are optional, but adding them helps CodeRabbit populate user profile details correctly.

    <Frame caption="Review the required and optional SAML attributes">
      <img src="https://mintcdn.com/coderabbit/GloY4hCsgvrKMG0G/assets/images/custom-self-serve-attributes.png?fit=max&auto=format&n=GloY4hCsgvrKMG0G&q=85&s=c94f63e11ccc5a9c36ee10321ac088b2" alt="Account management SSO wizard showing required and optional SAML attributes" width="1750" height="1040" data-path="assets/images/custom-self-serve-attributes.png" />
    </Frame>
  </Step>

  <Step title="Assign users or groups to the SAML app">
    In your identity provider, assign the users, groups, or organizational units that should be allowed to sign in to CodeRabbit through SSO.

    Users cannot complete SSO sign-in until they are assigned to the SAML application in your identity provider.

    <Frame caption="Assign users or groups before testing SSO">
      <img src="https://mintcdn.com/coderabbit/GloY4hCsgvrKMG0G/assets/images/custom-self-serve-assign-users.png?fit=max&auto=format&n=GloY4hCsgvrKMG0G&q=85&s=312ab307b6c0e5238a98cf7cdc73b1ea" alt="Account management SSO wizard reminding admins to assign users or groups before testing SSO" width="1752" height="900" data-path="assets/images/custom-self-serve-assign-users.png" />
    </Frame>
  </Step>

  <Step title="Add identity provider metadata">
    In your identity provider's SAML application, retrieve the metadata URL.

    Return to the account management SSO wizard. In **Configure identity provider metadata**, keep **Add via metadata** selected, paste the metadata URL, and continue.

    If your identity provider does not provide a metadata URL, select **Configure manually** and enter the SAML metadata values from your identity provider.

    <Frame caption="Paste the metadata URL from your identity provider">
      <img src="https://mintcdn.com/coderabbit/GloY4hCsgvrKMG0G/assets/images/custom-self-serve-metadata-url.png?fit=max&auto=format&n=GloY4hCsgvrKMG0G&q=85&s=ff2483b29f2860c6224bc969f0569636" alt="Account management SSO wizard with the Metadata URL input highlighted" width="1752" height="1030" data-path="assets/images/custom-self-serve-metadata-url.png" />
    </Frame>
  </Step>

  <Step title="Test the SSO connection">
    In **Test**, click **Open test URL** and complete the sign-in flow with a user who has access to the SAML app and whose email matches your verified domain.

    Return to the account management SSO wizard and click **Refresh logs** until the latest test result shows **Success**. Do not activate SSO while the latest result is **Pending** or failed.

    <Frame caption="Open the test URL and refresh logs until the result succeeds">
      <img src="https://mintcdn.com/coderabbit/GloY4hCsgvrKMG0G/assets/images/custom-self-serve-test-pending.png?fit=max&auto=format&n=GloY4hCsgvrKMG0G&q=85&s=297e4d47d2d9006cfa2b3ad91992f4bd" alt="Account management SSO wizard showing the Open test URL button and a pending test result with timestamp redacted" width="1756" height="1060" data-path="assets/images/custom-self-serve-test-pending.png" />
    </Frame>
  </Step>

  <Step title="Activate SSO">
    In **Activate**, review the activation message and click **Activate SSO**.

    <Warning>
      Activation changes sign-in behavior for the verified domain. After activation, users with that email domain must sign in to CodeRabbit through your identity provider.
    </Warning>

    <Frame caption="Activate SSO after the connection test succeeds">
      <img src="https://mintcdn.com/coderabbit/GloY4hCsgvrKMG0G/assets/images/custom-self-serve-activate.png?fit=max&auto=format&n=GloY4hCsgvrKMG0G&q=85&s=b344a34cb11548b827880777ca3eceb9" alt="Account management SSO wizard with the Activate SSO button highlighted and the domain redacted" width="1748" height="1100" data-path="assets/images/custom-self-serve-activate.png" />
    </Frame>
  </Step>
</Steps>

## What's next

<CardGroup cols={1}>
  <Card title="Enterprise SSO overview" href="/management/sso" icon="key" horizontal>
    Return to the SSO overview to understand how Enterprise SSO fits into your CodeRabbit rollout.
  </Card>

  <Card title="Roles and permissions" href="/management/roles" icon="shield-check" horizontal>
    Pair SSO with the right access controls by reviewing how roles work in your CodeRabbit organization.
  </Card>

  <Card title="Support" href="/support" icon="message-circle" horizontal>
    Contact CodeRabbit if the Security section is missing or the SSO test does not succeed.
  </Card>
</CardGroup>
