Skip to content

INTMDB-481: Add support for identity provider display name import #924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/Federated-Settings/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ resource "mongodbatlas_federated_settings_org_config" "org_connections_import" {
identity_provider_id = var.identity_provider_id
domain_restriction_enabled = false
domain_allow_list = ["yourdomain.com"]
post_auth_role_grants = ["ORG_MEMBER"]
}

resource "mongodbatlas_federated_settings_identity_provider" "identity_provider" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ func resourceMongoDBAtlasFederatedSettingsIdentityProviderImportState(ctx contex
return nil, fmt.Errorf("error setting Identity Provider in Federation settings (%s): %s", d.Id(), err)
}

if err := d.Set("name", federatedSettingsIdentityProvider.DisplayName); err != nil {
return nil, fmt.Errorf("error setting name (%s): %s", d.Id(), err)
}

if err := d.Set("sso_debug_enabled", federatedSettingsIdentityProvider.SsoDebugEnabled); err != nil {
return nil, fmt.Errorf("error setting sso debug enabled (%s): %s", d.Id(), err)
}
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/federated_settings_org_config.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ resource "mongodbatlas_federated_settings_org_config" "org_connections" {
org_id = "627a9683ea7ff7f74de306f14"
domain_restriction_enabled = false
domain_allow_list = ["mydomain.com"]
post_auth_role_grants = ["ORG_MEMBER"]
}

data "mongodbatlas_federated_settings_org_config" "org_configs_ds" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ resource "mongodbatlas_federated_settings_org_config" "org_connections" {
org_id = "627a9683ea7ff7f74de306f14"
domain_restriction_enabled = false
domain_allow_list = ["mydomain.com"]
post_auth_role_grants = ["ORG_MEMBER"]
}

data "mongodbatlas_federated_settings_org_configs" "org_configs_ds" {
Expand Down
3 changes: 3 additions & 0 deletions website/docs/r/federated_settings_org_config.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ resource "mongodbatlas_federated_settings_org_config" "org_connection" {
org_id = "627a9683ea7ff7f74de306f14"
domain_restriction_enabled = false
domain_allow_list = ["mydomain.com"]
post_auth_role_grants = ["ORG_MEMBER"]
identity_provider_id = "0oad4fas87jL7f75Xnk1297"
}

Expand All @@ -34,6 +35,8 @@ data "mongodbatlas_federated_settings_org_configs" "org_configs_ds" {
* `federation_settings_id` - (Required) Unique 24-hexadecimal digit string that identifies the federated authentication configuration.
* `org_id` - (Required) Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
* `domain_allow_list` - List that contains the approved domains from which organization users can log in.
* `post_auth_role_grants` - (Optional) List that contains the default [roles](https://www.mongodb.com/docs/atlas/reference/user-roles/#std-label-organization-roles) granted to users who authenticate through the IdP in a connected organization. If you provide a postAuthRoleGrants field in the request, the array that you provide replaces the current postAuthRoleGrants.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking but the 2nd half of this doesn't make a great deal of sense to a Terraform user, i.e. "If you provide a postAuthRoleGrants field in the request, the array that you provide replaces the current postAuthRoleGrants."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can update with "List that contains the default roles granted to users who authenticate through the IdP in a connected organization. If you provide a postAuthRoleGrants field in the request, the array that you provide replaces the current postAuthRoleGrants."

source - https://www.mongodb.com/docs/atlas/reference/api/org-mapping-update-one/#request-body-parameters:~:text=postAuthRoleGrants,current%20postAuthRoleGrants.


* `domain_restriction_enabled` - (Required) Flag that indicates whether domain restriction is enabled for the connected organization.
* `identity_provider_id` - (Required) Unique 24-hexadecimal digit string that identifies the federated authentication configuration.

Expand Down