A new platform for documentation and tutorials is launching soon.
We are migrating Terraform documentation into HashiCorp Developer, our new developer experience.
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. The first time you sign in with SSO, you must either provide a password to create a new Terraform Cloud user account (using your SSO email address as the username), or link your SSO identity to an existing Terraform Cloud user account. Once the SSO identity is linked, you can only log in to that organization using the linked account. You must remove the SSO link if you want to access the organization with a different 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
Visit https://app.terraform.io and sign out if you're signed in.
Click "Sign in via SSO".
Provide your organization name and click "Next".
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.
You will be redirected to your SSO identity provider. Authenticate your account as necessary.
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:
- Click Settings in the navigation bar and then click SSO in the sidebar. The SSO configuration page appears.
- Toggle the Enable team management to customize your team attribute.
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.
SSO Team IDs are particularly helpful if your SSO or Active Directory provider restricts the
MemberOf attribute in its SAML responses to Group UUIDs, rather than human readable group names. Setting the SSO Team ID allows you to maintain human readable team names in Terraform Cloud, while still managing team membership through SSO or Active Directory.
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.