diff --git a/auth0/resource_auth0_connection.go b/auth0/resource_auth0_connection.go index 2dc4f5c7e..0466bbb8c 100644 --- a/auth0/resource_auth0_connection.go +++ b/auth0/resource_auth0_connection.go @@ -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}, diff --git a/auth0/structure_auth0_connection.go b/auth0/structure_auth0_connection.go index 57236a6ef..7ce426b6c 100644 --- a/auth0/structure_auth0_connection.go +++ b/auth0/structure_auth0_connection.go @@ -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 { @@ -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) { diff --git a/docs/resources/connection.md b/docs/resources/connection.md index 63b093d4b..b205f0a70 100644 --- a/docs/resources/connection.md +++ b/docs/resources/connection.md @@ -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