Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Latest commit

 

History

History
92 lines (50 loc) · 6.54 KB

File metadata and controls

92 lines (50 loc) · 6.54 KB
page_title description
Single Sign-on - Terraform Cloud and Terraform Enterprise
Learn how single sign-on (SSO) works in Terraform Cloud, how to sign in with SSO, and more.

Single Sign-on

-> Note: Single sign-on is a paid feature, available as part of the Business upgrade package. Learn more about Terraform Cloud pricing here.

~> Important: This page is about configuring single sign-on in Terraform Cloud. Terraform Enterprise's single sign-on is configured differently. If you administer a Terraform Enterprise instance, see Terraform Enterprise: SAML Configuration.

Terraform Cloud allows organizations to configure support for SAML 2.0 single sign-on (SSO), an alternative to traditional user management. By using SSO, your organization can centralize management of users for Terraform Cloud and other Software-as-a-Service (SaaS) vendors, providing greater accountability and security for an organization's identity and user management.

Current users of Terraform Cloud can link their SSO identity to their existing account, providing a smooth transition when an organization enables SSO.

Supported Identity Providers (IdPs)

Select your preferred provider to learn more about what is supported for that provider and how to configure SSO for it.

How SSO Works

Organization owners can enable SSO for their organization and configure an identity provider to connect to.

Once SSO is enabled for an organization, all non-owner members must sign in through SSO in order to access the organization. (Owners of an SSO-enabled organization can still access the organization through username and password, to enable fixing problems with SSO.)

SSO Identities and Terraform Cloud User Accounts

SSO does not automatically provision Terraform Cloud user accounts. A user signing in for the first time with SSO must either provide a password to create a new Terraform Cloud user account (using their SSO email address as their username), or must link their SSO identity to an existing Terraform Cloud user account.

The accounts of SSO users are normal Terraform Cloud user accounts. If logged in with username and password, these accounts can create, join, and interact with other Terraform Cloud organizations. However, they cannot interact with the SSO-enabled organization without signing in via SSO unless they belong to its owners team.

If an organization's owners disable SSO (or downgrade the organization's account from the Business tier), all members can continue to access the organization using their Terraform Cloud usernames and passwords.

Signing in with SSO

  1. Visit https://app.terraform.io and sign out if you're signed in.

  2. Click "Sign in via SSO".

  3. Provide your organization name and click "Next".

    Screenshot: The Terraform Cloud SSO sign-in page, asking for an organization name.

  4. If you've signed in to Terraform Cloud with SSO before, proceed to the next step.

    If you're signing in for the first time under this account or for the first time accessing this organization, you'll be required to create a new account or link to an existing account. Use the links below the account creation form if you want to link your SSO identity to an existing account, then fill out and submit the relevant form.

    Screenshot: Terraform Cloud's create account page.

    Screenshot: The password prompt for linking an SSO email address to the currently signed-in Terraform Cloud account.

    Screenshot: the username and password prompt for linking an SSO email address to another Terraform Cloud account.

  5. You will be redirected to your SSO identity provider. Authenticate your account as necessary.

  6. You are now signed in to Terraform Cloud.

Managing Team Membership Through SSO

Terraform Cloud can automatically add users to teams based on their SAML assertion, so you can manage team membership in your directory service.

To enable team membership mapping:

  1. Click Settings in the navigation bar and then click SSO in the sidebar. The SSO configuration page appears.
  2. Toggle the Enable team management to customize your team attribute.

Screenshot: the Terraform Cloud SAML team membership toggle

When team management is enabled, you can configure which SAML attribute in the SAMLResponse will control team membership. This defaults to the MemberOf attribute. The expected format of the corresponding AttributeValue in the SAMLResponse is a either a string containing a comma-separated list of teams, or separate AttributeValue items specifying teams.

When users log in through SAML, Terraform automatically adds them to the teams included in their assertion and automatically removes them from teams that are not included in their assertion. This automatic mapping overrides any manually set team memberships. Each time the user logs in, their team membership is adjusted to match their SAML assertion.

Terraform Cloud ignores team names that do not exactly match existing teams and will not create new teams from those listed in the assertion. If the chosen SAML attribute is not provided in the SAMLResponse, Terraform assigns users to a default team named sso and does not remove them from any existing teams.

It is not possible to assign users to the owners team through this attribute.

Team Names and SSO Team IDs

Terraform Cloud expects the team names in the team membership SAML attribute to exactly match its own team names or its configured SSO Team IDs. This match is case sensitive.

You can configure SSO Team IDs in the organization's Teams page. If an SSO Team ID is configured, Terraform Cloud will attempt to match the chosen SAML attribute against both the team name and the SSO Team ID when mapping users to teams. You may want to create an SSO Team ID if the team membership SAML attribute is not human readable and is not used as the team's name in Terraform Cloud.

NameID Format

Terraform Cloud requires that the NameID format in the SAML response be set to urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress with a valid email address being provided as the value for this attribute.