Skip to content

Commit

Permalink
Adding metadata_xml and metadata_url to connection schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Vedder committed Jun 28, 2022
1 parent 0fe365e commit 8debe65
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions auth0/resource_auth0_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,16 @@ var connectionSchema = map[string]*schema.Schema{
Optional: true,
Description: "When enabled, will disable sign out.",
},
"metadata_xml": {
Type: schema.TypeString,
Optional: true,
Description: "The XML content for the SAML metadata document.",
},
"metadata_url": {
Type: schema.TypeString,
Optional: true,
Description: "The URL of the SAML metadata document.",
},
"fields_map": {
Type: schema.TypeMap,
Elem: &schema.Schema{Type: schema.TypeString},
Expand Down
4 changes: 4 additions & 0 deletions auth0/structure_auth0_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ func flattenConnectionOptionsSAML(options *management.ConnectionOptionsSAML) int
"set_user_root_attributes": options.GetSetUserAttributes(),
"non_persistent_attrs": options.GetNonPersistentAttrs(),
"entity_id": options.GetEntityID(),
"metadata_url": options.GetMetadataURL(),
"metadata_xml": options.GetMetadataXML(),
}

if options.IdpInitiated != nil {
Expand Down Expand Up @@ -781,6 +783,8 @@ func expandConnectionOptionsSAML(d ResourceData) *management.ConnectionOptionsSA
SetUserAttributes: String(d, "set_user_root_attributes"),
NonPersistentAttrs: castToListOfStrings(Set(d, "non_persistent_attrs").List()),
EntityID: String(d, "entity_id"),
MetadataXML: String(d, "metadata_xml"),
MetadataURL: String(d, "metadata_url"),
}

List(d, "idp_initiated").Elem(func(d ResourceData) {
Expand Down
2 changes: 2 additions & 0 deletions docs/resources/connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,8 @@ With the `samlp` connection strategy, `options` supports the following arguments
* `set_user_root_attributes` - (Optional) Determines whether the 'name', 'given_name', 'family_name', 'nickname', and 'picture' attributes can be independently updated when using the external IdP. Default is `on_each_login` and can be set to `on_first_login`.
* `non_persistent_attrs` - (Optional) If there are user fields that should not be stored in Auth0 databases due to privacy reasons, you can add them to the denylist. See [here](https://auth0.com/docs/security/denylist-user-attributes) for more info.
* `entity_id` - (Optional) Custom Entity ID for the connection.
* `metadata_url` - (Optional) URL of the SAML metadata document.
* `metadata_xml` - (Optional) XML content for the SAML metadata document.

**Example**:
```hcl
Expand Down

0 comments on commit 8debe65

Please sign in to comment.