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

Commit

Permalink
Update Cloud docs to specify that the SSO Team membership SAML attrib…
Browse files Browse the repository at this point in the history
…ute can be configured
  • Loading branch information
JarrettSpiker committed Apr 1, 2022
1 parent b0cf58c commit 68c96df
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
10 changes: 5 additions & 5 deletions content/cloud-docs/api-docs/teams.mdx
Expand Up @@ -77,7 +77,7 @@ $ curl \

### Sample Response

_The `sso-team-id` attribute is only returned if this team's organization is in the Terraform Cloud Business tier._
The `sso-team-id` attribute is only returned if this team's organization is in the Terraform Cloud Business tier.

```json
{
Expand Down Expand Up @@ -180,7 +180,7 @@ $ curl \

### Sample Response

_The `sso-team-id` attribute is only returned if this team's organization is in the Terraform Cloud Business tier._
The `sso-team-id` attribute is only returned if this team's organization is in the Terraform Cloud Business tier.

```json
{
Expand Down Expand Up @@ -243,7 +243,7 @@ $ curl \

### Sample Response

_The `sso-team-id` attribute is only returned if this team's organization is in the Terraform Cloud Business tier._
The `sso-team-id` attribute is only returned if this team's organization is in the Terraform Cloud Business tier.

```json
{
Expand Down Expand Up @@ -312,7 +312,7 @@ Properties without a default value are required.
| --------------------------------------- | ------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `data.type` | string | | Must be `"teams"`. |
| `data.attributes.name` | string | (previous value) | The name of the team, which can only include letters, numbers, `-`, and `_`. This will be used as an identifier and must be unique in the organization. |
| `data.attributes.sso-team-id` | string | (previous value) | The unique identifier of the team from the SAML `MemberOf` attribute. Only available if the team belongs to an organization in the paid Terraform Cloud Business Tier. |
| `data.attributes.sso-team-id` | string | (previous value) | The unique identifier of the team from the SAML `MemberOf` attribute. Only available if the team belongs to an organization in the paid Terraform Cloud Business tier. |
| `data.attributes.organization-access` | object | (previous value) | Settings for the team's organization access. This object can include `manage-policies`, `manage-policy-overrides`, `manage-workspaces`, `manage-vcs-settings`, `manage-providers`, and `manage-modules` properties with boolean values. All properties default to `false`. |
| `data.attributes.visibility` **(beta)** | string | (previous value) | The team's visibility. Must be `"secret"` or `"organization"` (visible). |

Expand Down Expand Up @@ -345,7 +345,7 @@ $ curl \

### Sample Response

_The `sso-team-id` attribute is only returned if this team's organization is in the Terraform Cloud Business tier._
The `sso-team-id` attribute is only returned if this team's organization is in the Terraform Cloud Business tier.

```json
{
Expand Down
Expand Up @@ -63,13 +63,26 @@ If an organization's owners disable SSO (or downgrade the organization's account

## 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 do this, you must specify the `MemberOf` SAML attribute, and make sure the AttributeStatement in the SAMLResponse contains a list of AttributeValue items in the correct format (i.e., comma-separated list of team names or SSO team IDs).
Terraform Cloud can automatically add users to teams based on their SAML assertion, so you can manage team membership in your directory service.

If the SAML assertion includes a `MemberOf` attribute, users logging in via SSO are automatically added to the teams included in their assertion and removed from any teams that _aren't_ included in their assertion. This overrides any manually set team memberships; whenever the user logs in, their team membership is adjusted to match their SAML assertion.
Team membership mapping is controlled with the "Enable team management" toggle on the SSO configuration page of your Organization settings.

Any team names that don't match existing teams are ignored; Terraform Cloud will not automatically create new teams. Terraform Cloud expects the team names in the `MemberOf` SAML attribute to exactly match its own team names or SSO team IDs. This match is case sensitive. It is not possible to assign users to the `owners` team through this attribute.
![Screenshot: the Terraform Cloud SAML team membership toggle](/img/docs/saml-team-membership-cloud.png)

If the `MemberOf` attribute is not provided, users are assigned to a default team named `sso` and are not removed from any existing teams.
When enabled, you may 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 team membership management is enabled, users logging in via SAML are automatically added to the teams included in their assertion, and automatically removed from any teams that _aren't_ included in their assertion. This overrides any manually set team memberships; whenever the user logs in, their team membership is adjusted to match their SAML assertion.

Any team names that don't match existing teams are ignored; Terraform Cloud will not automatically create new teams. If the chosen SAML attribute is not provided in the SAMLResponse, users are assigned to a default team named `sso` and are not removed 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

Expand Down
Binary file added public/img/docs/saml-team-membership-cloud.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 68c96df

Please sign in to comment.