# Add identity providers

Add SSO identity providers (IdPs) in the Redocly platform, so users can use them for logging into Redocly as well as individual projects.
After you have added an IdP in Redocly, the identity provider can then be configured in the `redocly.yaml` configuration file for individual projects.

## Before you begin

Make sure you have the following:

- a SAML 2 or OpenID Connect-based identity provider
- the following information about your identity provider:
    - SAML 2
          - Single sign on URL
          - Issuer ID
          - x509 public certificate
          - NameID format set to email address
          - the following standard SAML attributes (claims) are supported:
                  - `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname`
                  - `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname`
                  - `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name`
    - OpenID Connect
          - either a configuration JSON or URL
          - Client ID
          - Client Secret
- `owner` role in your organization

## Add a Corporate identity provider

Corporate identity providers authenticate internal users into Redocly and projects.
You can add multiple Corporate identity providers for your organization and target a specific one at project login by configuring [`access.idps`](/docs/platform/config/access/idps).

1. In your Organization's workspace, in the navigation menu, select **Access** > **SSO and login**.
2. Click the **Add** button and from the dropdown list select either **SAML 2** or **OpenID Connect**.
3. Complete the form based on the information you have gathered about your SSO identity provider.
  In the **Login type** dropdown, select **Corporate**.
4. Click **Save**.

## Add a Guest identity provider

Guest identity providers authenticate external users into projects.
You can add multiple Guest identity providers for your organization and target a specific one at project login by configuring [`access.idps`](/docs/platform/config/access/idps).

1. In your Organization's workspace, in the navigation menu, select **Access** > **SSO and login**.
2. Click the **Add** button and from the dropdown list select either **SAML 2** or **OpenID Connect**.
3. Complete the form based on the information you have gathered about your SSO identity provider.
  In the **Login type** dropdown, select **Guest**.
4. Click **Save**.

## Team mapping

Team mapping is an option when you add Corporate or Guest IdPs.
It labels your IdP groups in the Redocly platform.
The option is called "team claim mapping" for OpenID Connect, and "team attribute mapping" for SAML 2.

You can also use team mapping to assign IdP groups to [project RBAC teams](/docs/platform/config/access/rbac#team-to-role-map) or [organization roles](/docs/platform/access/roles#reserved-organization-role-names) other than the defaults.

When users log in with an IdP, their groups become synced teams in Redocly.
Both the group name and the mapped team name become teams.
A group mapped to an organization role sets that role and never becomes a team.
A sign-in that carries no group claim removes the person from the synced teams of that IdP but keeps them in the IdP's default team.
Teams managed in Redocly do not change.

A group named `<project-slug>.<project-role>` gives its members the [project role](/docs/platform/organization/teams#project-role-teams) on that project.
This behavior applies to Corporate and Guest IdPs.
The Owner-only rule for these team names applies only to teams created or renamed in Redocly.

To map IdP groups to Redocly default teams or project RBAC teams:

1. Select the **Configure team attribute mapping** or **Configure team claim mapping** checkbox.
2. Enter the IdP group name in the Value text box on the left side.
3. Enter the [Redocly default team tied to an organization role](/docs/platform/access/roles#reserved-organization-role-names) or [project's RBAC team name](/docs/platform/config/access/rbac#team-to-role-map) into the **Team** text box on the right side.
4. Click the **Add mapping** button to add additional mappings as needed.
5. Click **Save**.

When users assigned to those groups in your IdP log in to Redocly, they have the project or organization role access assigned to those teams.

### Default team

Enter a **Default Team** name to add everyone who logs in with this IdP to a synced team with that name.
The team appears on the **Teams** page with the identity provider as its source.
A sign-in that carries no group claim keeps the person in the default team and removes them from the other synced teams of this IdP.
Use a team name from the `rbac` configuration in `redocly.yaml` to grant its roles.

## Verified domains

Verified domains connect users to an organization by email domain.
Add a verified domain on the **SSO and login** page in Redocly.

Each user who signs in through one of your identity providers enters a code one time to confirm their email address.
Redocly sends the code to that address.
When the user enters the code depends on whether they already have a Redocly account:

- A new user enters the code on the **Verify email** page at their first sign-in to the Redocly platform.
  Redocly doesn't ask for the code when a new user signs in to a project.
- A user who already has a Redocly account with another sign-in method, such as a password, enters the code on the **Link account** page.
  Redocly asks for the code at the user's first sign-in, to the Redocly platform or to a project.

Redocly doesn't ask for a code when the user's email address is at a verified domain of your organization.
If your organization doesn't allow passwords, Redocly redirects a password sign-in with an email at a verified domain to your organization's sign-in page.
The redirect applies only when logging in to the Redocly platform, not to projects.
The redirect requires the Enterprise plan, unless your organization allows only identity providers.
It applies to everyone with an email at that domain, not only to members of your organization.
The sign-in page lists the [sign-in methods](#choose-sign-in-methods) your organization allows.

Otherwise, users with a verified domain email can still sign in with password, Google, or Microsoft.

## Choose sign-in methods

Choose how members of your organization sign in to the Redocly platform.
The **Sign-in methods** section lists password, Google, Microsoft, and each of your Corporate identity providers.
Guest identity providers are not listed, because they apply to projects only.
By default, every method is allowed, and each Corporate identity provider you add is allowed automatically.

Members who signed in with a method that is not allowed must sign in again with an allowed method.
Members who signed in to another organization through its identity provider can't use that sign-in to access your organization or its projects, even if you allow every method.
They must sign in again with a method you allow.

This setting doesn't affect how users access your deployed project.
To require login to your project, you must configure `rbac` or `requiresLogin`.
See [Configure RBAC](/docs/platform/access) or [requiresLogin](/docs/platform/config/access/requires-login) for configuration instructions.

To allow only identity providers, your organization needs the Enterprise plan, at least one verified domain, and no unverified domains.
You must also be signed in through one of your identity providers.
Before you allow only identity providers, verify that users can sign in with your IdPs.

If your organization moves to a plan without SSO, it keeps its sign-in methods, but you can't change them.
To allow another method, contact Redocly support.

**Risk of member lockout**

Members who can't use any allowed method lose access to the organization.
Before you clear a method, make sure the members who use it can sign in with another allowed method.

To choose sign-in methods:

1. In your Organization's workspace, in the navigation menu, select **Access** > **SSO and login**.
2. In the **Sign-in methods** section, select the methods members can use, and clear the others.
  You can't clear the method you are signed in with, because that would sign you out.
3. If you allow only identity providers, click the **Test connection** button.
  In the window that opens, authenticate in your IdP.
4. If you were able to authenticate successfully, click **Save**.

You can't remove an identity provider when it is the only allowed sign-in method, or when removing it would sign you out.
To remove it, allow another method first, or sign in with a method that stays allowed.
You also can't change an identity provider to Guest when it is the only allowed sign-in method.

## IP allow lists

If you use a self-hosted identity provider or an identity provider with an IP allow list, allow these IP addresses.
Redocly connects from them to reach your identity provider:

**US region:**

```sh
3.211.34.228
44.206.14.241
54.156.60.142
```

**EU region:**

```sh
3.78.112.49
52.58.255.31
3.66.111.193
```

## Resources

- **[Configure SCIM](/docs/platform/organization/sso/configure-scim)** - Enable SCIM 2.0 provisioning and deprovisioning for an identity provider
- **[Configure project SSO](/docs/platform/organization/sso/configure-sso)** - Specify which identity providers users can access or disable SSO entirely for your project authentication settings
- **[Control site access](/docs/platform/access)** - Limit user access to specific pages and features in your project and Redocly using role-based access control
- **[SSO configuration reference](/docs/platform/config/access/sso)** - Complete technical reference for all available SSO configuration options and implementation details
- **[Single sign-on and login](/docs/platform/organization/sso/sso)** - Understand different identity provider categories and their configuration options for both the platform and redocly.yaml file setup
- **[Role-based access control](/docs/platform/access/rbac)** - Understand the components and architecture of Redocly's role-based access control system
- **[RBAC configuration reference](/docs/platform/config/access/rbac)** - Examples and configuration options for implementing RBAC in your redocly.yaml file with detailed setup instructions
