# Set up single sign-on




To set up a single sign-on (SSO), you need to establish a connection between
Docker and your identity provider (IdP). Docker supports any SAML 2.0 identity
provider, and Microsoft Entra ID (formerly Azure AD) for OpenID Connect (OIDC).
This guide uses Okta for SAML 2.0 and Microsoft Entra ID for SAML 2.0 and OIDC.
For another SAML 2.0 provider, follow the SAML steps with that provider's
values.

If you're unfamiliar with the SSO process, first review
[SSO overview](/security/authentication/single-sign-on/) to
learn about how SSO works.

## Prerequisites

Before you begin, make sure the following conditions are met:

- Notify your company about the upcoming SSO sign-in process.
- Confirm that each Docker user has a valid IdP account using the same email
  address as their User Principal Name (UPN).
- Ensure CI/CD pipelines use PATs or OATs instead of passwords.

## Set up an SSO connection

> [!TIP]
>
> These procedures have you copy and paste values between Docker and your IdP.
> Complete this guide in one session with separate browser windows open for
> Docker and your IdP.

### Step 1: Add a domain

To add a domain:

1. Sign in to [app.docker.com](https://app.docker.com), then choose your
   organization. If your organization is part of a company, then select the
   company to manage the domain at the company level.
1. Select **Identity & auth**, then **Domain management**.
1. Select **Add a domain**.
1. Enter your domain in the text box and select **Add domain**.
1. In the modal, copy the **TXT Record Value** provided for domain verification.

### Step 2: Verify your domain

To confirm domain ownership, add a TXT record to your Domain Name System (DNS)
host using the TXT Record Value from Docker. DNS propagation can take up to 72
hours. Docker automatically checks for the record during this time.

> [!TIP]
>
> When adding a record name, use `@` or leave it empty for root domains like
> `example.com`. Avoid common values like `docker`, `docker-verification`,
> `www`, or your domain name itself. Always check your DNS provider's
> documentation to verify their specific record name requirements.

**AWS Route 53**



1. To add your TXT record to AWS, see
   [Creating records by using the Amazon Route 53 console](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-creating.html).
1. Wait up to 72 hours for TXT record verification.
1. After the record is live, go to **Identity & auth**, then **Domain
   management**, and select **Verify**.

**Google Cloud DNS**



1. To add your TXT record to Google Cloud DNS, see
   [Verifying your domain with a TXT record](https://cloud.google.com/identity/docs/verify-domain-txt).
1. Wait up to 72 hours for TXT record verification.
1. After the record is live, go to **Identity & auth**, then **Domain
   management**, and select **Verify**.

**GoDaddy**



1. To add your TXT record to GoDaddy, see
   [Add a TXT record](https://www.godaddy.com/help/add-a-txt-record-19232).
1. Wait up to 72 hours for TXT record verification.
1. After the record is live, go to **Identity & auth**, then **Domain
   management**, and select **Verify**.

**Other providers**



1. Sign in to your domain host.
1. Add a TXT record to your DNS settings and save the record.
1. Wait up to 72 hours for TXT record verification.
1. After the record is live, go to **Identity & auth**, then **Domain
   management**, and select **Verify**.



### Step 3: Create an SSO connection in Docker

1. From [app.docker.com](https://app.docker.com), choose your organization.
1. Select **Identity & auth**, then **SSO and SCIM**.
1. Select **Create Connection** and name the connection.

The dialog offers two connection types. Select the type that matches the
identity provider tab you use in the next step.

**SAML 2.0**



Use this type for the Okta SAML and Entra ID SAML 2.0 tabs.

1. Select **SAML 2.0**.
1. Copy **Entity ID**, **ACS URL**, and **Connection ID**. For SAML
   configuration, paste these values into your identity provider.

**Azure AD (OIDC)**



Use this type for the Azure OpenID Connect (OIDC) tab.

1. Select **Azure AD (OIDC)**.
1. Copy **Redirect URI**. For Azure AD configuration, paste the Redirect
   URI, also called the **Reply URL**, into your identity provider.



Keep this window open. You will return here to finish connecting after
creating an SSO connection in your IdP.

### Step 4: Create an SSO connection in your IdP

Use the following tabs based on your IdP provider.

**Okta SAML**



You need
[super admin permissions](https://help.okta.com/en-us/content/topics/security/administrators-super-admin.htm)
for the Okta org.

1. Sign in to your Okta Admin account. From the top nav, select the **Admin**
   button to go to Okta's Admin Console.
1. From the **Applications** section in the left nav, choose **Applications**.
   Select **Create App Integration**.
1. Choose SAML 2.0 to match your selection from Docker Home.
1. For **General Settings**, name your app "Docker." Uploading a logo is
   optional.
1. For **Configure SAML**, input the following values:
   - For the **Single Sign On URL** value, paste the Docker ACS URL.
   - For the **Audience URI (SP Entity ID)** value, paste the Docker Entity ID.
   - For **Name ID format**, choose `EmailAddress`
   - For **Application username**, choose `Email`
   - For **Update application username on**, choose `Create and update`
   - Optional. Add
     [SAML attributes](/security/provisioning/#sso-attributes),
     if required by your org.
1. For **Feedback**, choose **This is an internal app that we have created**
   checkbox before finishing.

Keep your Okta window open for the next step.

**Entra ID SAML 2.0**



To enable SSO with Microsoft Entra, you need
[Cloud Application Administrator](https://learn.microsoft.com/en-us/entra/identity/role-based-access-control/permissions-reference#cloud-application-administrator)
permissions.

1. From Microsoft Entra admin center, select **Entra ID**, then go to
   **Enterprise apps**. Select **All applications**.
1. Choose **Create your own application** and name your app "Docker". Select
   **Non-gallery**.
1. After creating your app, go to **Single Sign-On** and select **SAML**.
1. Select **Edit** on the **Basic SAML configuration** section. From **Basic
   SAML configuration**, choose **Edit** and paste the values you copied from
   creating an SSO connection in Docker:
   - For the **Identifier** value, paste the Docker Entity ID.
   - For the **Reply URL** value, paste Docker ACS URL.
1. Optional. Add
   [SAML attributes](/security/provisioning/#sso-attributes),
   if required by your org.
1. From the **SAML Signing Certificate** section, download your **Certificate
   (Base64)**.

**Azure OpenID Connect (OIDC)**



#### Register the app

1. Sign in to [Microsoft Entra admin center](https://entra.microsoft.com/).
1. Go to **App Registration** and select **New Registration**.
1. Name the application "Docker".
1. Set account types and paste the **Redirect URI** from Docker.
1. Select **Register**.
1. On the app registration **Overview** page, copy **Application (client)
   ID**. This value is the Docker **Client ID**.

#### Create client secrets

1. In your app, go to **Certificates & secrets**.
1. Select **New client secret**, describe and configure duration, then **Add**.
1. Copy the secret **Value**, not the **Secret ID**. The **Value** is the
   Docker **Client Secret**.

   **Value** is the secret string Entra generated. Docker uses it when someone
   signs in with this connection. Entra shows the **Value** on this screen
   only. If you leave the page or refresh it, the column is blank. Create a
   new secret and copy its **Value** before you leave.

   **Secret ID** is the identifier for that row. It stays visible so you can
   tell two secrets apart, see which secret is about to expire, or delete a
   specific one. Entra does not accept the **Secret ID** as the **Client
   Secret**.

#### Set API permissions

1. In your app, go to **API permissions**.
1. Select **Grant admin consent** and confirm.
1. Select **Add a permission**, then **Delegated permissions**.
1. Search and select `User.Read`.
1. Confirm that admin consent is granted.



### Step 5: Connect Docker to your IdP

Complete the integration by pasting your IdP values into Docker.

> [!IMPORTANT]
>
> When prompted to copy a certificate, copy the entire certificate starting with
> `-----BEGIN CERTIFICATE-----` and including the
> `-----END CERTIFICATE-----` lines.

**Okta SAML**



1. Go to **Applications** and choose **Applications**. Choose your app from the
   **ACTIVE** table.
1. From **Sign on**, go to **View SAML setup instructions**. This page contains
   the **SAML Sign-in URL** and **x509 Certificate**. Keep this page open.
1. Return to your opened Docker window for the **Create single sign-on
   connection** step. Paste in the **SAML Sign-in URL** and **x509 Certificate**
   values.
1. Optional. Select a default team, if required by your org.
1. Review and select **Create connection**.

**Entra ID SAML 2.0**



1. Open your downloaded **Certificate (Base64)** in a text editor.
1. Copy the following values:
   - From Azure AD: **Login URL**
   - **Certificate (Base64)** contents
1. Return to Docker Home, then paste the **Login URL** and **Certificate
   (Base64)** values.
1. Choose your domain from the drop-down.
1. Optional. Select a default team, if required by your org.
1. Review and select **Create connection**.

**Azure OpenID Connect (OIDC)**



1. Return to Docker Home.
1. Paste the following values:
   - **Client ID**: the **Application (client) ID** you copied
   - **Client Secret**: the secret **Value** you copied
   - **Azure AD Domain**
1. Optional. Select a default team, if required by your org.
1. Review and select **Create connection**.



### Step 6: Test the connection

IdPs like Microsoft Entra and Okta may require that you assign a user to an
application before testing SSO. You can review
[Microsoft Entra](https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/add-application-portal-setup-sso#test-single-sign-on)'s
documentation and
[Okta](https://help.okta.com/wf/en-us/content/topics/workflows/connector-reference/okta/actions/assignusertoapplicationforsso.htm)'s
documentation to learn how to assign yourself or other users to an app.

After assigning yourself to an app:

1. Open an incognito browser window and sign in to Docker Home using your domain
   email address.
1. When redirected to your IdP's sign-in page, authenticate with your domain
   email instead of using your Docker ID.

If you have multiple IdPs, choose the sign-in option **Continue with SSO**. If
you're using the CLI, you must authenticate using a personal access token.

## Configure multiple IdPs

Docker supports multiple identity provider (IdP) configurations by letting you
associate one domain with more than one IdP. Each connection must use the same
domain, which lets users choose their IdP when they select **Continue with SSO**
at sign in.

To add multiple IdPs:

1. Use the same domain for each connection.
1. Repeat steps 3-6 from the
   [Set up an SSO connection](/security/authentication/single-sign-on/connect/#set-up-an-sso-connection)
   procedures on this page. Repeat these steps for each IdP your organization
   intends to use.

Because you must use the same domain for each IdP, you won't need to repeat
steps to add and verify your domains.

## Enforce SSO

If SSO isn't enforced, users can still sign in using Docker usernames and
passwords. Enforcing SSO requires users to use SSO when signing into Docker,
which centralizes authentication and enforces policies set by the IdP.

Before enforcing SSO, users accessing Docker through the CLI must
[create a personal access token (PAT)](/security/access-tokens/personal-access-tokens/).
The PAT replaces their password for authentication. For CI/CD and other
automation, replace passwords with a PAT or an
[organization access token (OAT)](/security/access-tokens/organization-access-tokens/).
For GitHub Actions, you can use an
[OIDC connection](/security/authentication/oidc-connections/)
instead of storing a long-lived token.

1. Sign in to [Docker Home](https://app.docker.com/) and select your
   organization or company.
1. Select **Identity & auth**, then **SSO and SCIM**.
1. In the SSO connections table, select the **Action** menu, then **Enable
   enforcement**.
1. Follow the on-screen instructions.
1. Select **Turn on enforcement**.

When you enforce SSO, your users can't modify their email address and password,
convert a user account to an organization, or set up 2FA through Docker Hub. If
you want to use 2FA, you must enable 2FA through your IdP.

## Next steps

- [Provision users](/security/provisioning/).
- [Enforce sign-in](/desktop/enterprise/enforce-sign-in/).
- [Choose a PAT or OAT](/security/access-tokens/).
- [Set up OIDC connections for GitHub Actions](/security/authentication/oidc-connections/).
- [Troubleshoot SSO](/security/authentication/single-sign-on/troubleshoot-sso/)
  issues.

