# Logging in via SAML SSO

:::note[Adding new users to workspaces with enforced SAML SSO]

This page is for users trying to log in via SAML SSO after getting an invite. For workspace admins looking to add users to workspaces that have SAML SSO enforced, check out [Adding a new user to a Workspace with enforced SAML SSO](/bitrise-platform/accounts/saml-sso-in-bitrise/configuring-saml-sso-on-bitrise#adding-a-new-user-to-a-workspace-with-enforced-saml-sso).

:::

The exact process depends on how SAML SSO is configured for the workspace and whether the workspace has a [verified domain](/bitrise-platform/accounts/saml-sso-in-bitrise/configuring-scim).

## Logging in via SAML for new users

1. Open the Bitrise [sign-up](https://app.bitrise.io/users/sign_up) page and click **Sign up with SSO**.
1. Enter your work email address and click **Continue with SSO**.
1. Follow the instructions:

   - If your workspace has a [verified domain](/bitrise-platform/accounts/saml-sso-in-bitrise/configuring-scim) matching your email's domain, you will be redirected to log in to the identity provider. After logging in, you will be redirected to Bitrise: provide a username and click **Finalize account**. You will receive an email with a confirmation link.
   - If your workspace doesn't have a verified domain or if it doesn't match your email's domain, you will be asked to check your inbox. An email is sent with a secure login link that contains the available workspaces that use SAML SSO. To finish signing in to the workspaces, click the links in the email. You will be redirected to Bitrise to enter your username and finalize the account.

## Logging in to SAML SSO for existing users

If a workspace switches to using SAML SSO to log in, members might need to authorize SAML SSO separately, depending on the workspace configuration.

1. Open the [Bitrise login](https://app.bitrise.io/users/sign_in) page.
1. Click **Continue with SSO**.
1. Enter your email address.
1. Follow the instructions:

   - If your workspace has a [verified domain](/bitrise-platform/accounts/saml-sso-in-bitrise/configuring-scim) matching your email's domain, you will be redirected to the identity provider's site to log in. After successfully logging in, you will be redirected to Bitrise.
   - If your workspace doesn't have a verified domain or if it doesn't match your email's domain, you need to authorize SAML SSO the first time you use it. After you log in at the identity provider, Bitrise sends you an email. Click **Authorize SSO access** in the email, log in to Bitrise with your current credentials if asked, and click **Switch to SSO**. If the workspace enforces SAML SSO, Bitrise asks for your Bitrise password, plus your two-factor code if you set one up, instead of a login, and then sends you to log in at the identity provider. The link expires after one hour, and only the link in the most recent email works. If the link has expired, log in via SSO again to get a new email. If you're already logged in to Bitrise when you log in at the identity provider, Bitrise shows the authorization page right away, without an email.

## Multiple workspaces with the same verified domain

When a new user tries to log in via SSO the first time, Bitrise looks for a verified domain matching the user's email domain. If multiple workspaces share the same verified domain, Bitrise might not automatically be able to redirect a new user to the correct workspace. In this case, you will receive an email stating that we couldn't find an existing workspace associated with that address in our system.

We recommend one of the following workarounds:

- **Launch Bitrise directly from the identity provider's site**: For example, create a tile in Okta for Bitrise and use that to log in. In this way, the user will be redirected to the correct workspace.
- **Add the user to the correct Workspace**: A workspace owner should add the user as a member to the workspace they need before attempting to log in: [Workspace collaboration](/bitrise-platform/workspaces/collaboration-and-permissions-in-workspaces/workspace-collaboration).
- **Find and copy the login URL from the Workspace settings page**: Open the page, select **Single Sign-on** on the left, and go to the **SAML SSO** tab. Find the **Login URL to the Workspace** and click **Copy**.
