Update SAML configuration
Updates an existing SAML configuration.
Query parameters
-
When specified, checks for conflicts against the version stored in the persistent store (returned in 'x-cloud-resource-version' of the GET request)
Body
Required
The SAML configuration
-
The identifier for the security realm
-
The friendly name of the security realm
-
The configuration for the Elasticsearch security SAML Identity Provider.
-
The configuration for the Elasticsearch security SAML Service Provider.
-
The mapping configuration for the Elasticsearch security SAML attribute.
-
The NameID format. If not specified the IdP default is used. Example: 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent'
-
The mapping ruleset for the Elasticsearch security SAML role.
-
When true, enables the security realm
-
The order that the security realm is evaluated
-
Specifies whether to set the ForceAuthn attribute when requesting that the IdP authenticate the current user. If set to true, the IdP is required to verify the user's identity, irrespective of any existing sessions they might have.
-
The SAML signing certificate bundle URL. The bundle should be a zip file containing 'signing.key' and 'signing.pem' files in the directory '/saml/:id', where :id is the value of the [id] field.
-
The password to the signing certificate bundle
-
A list of SAML message types that should be signed. Each element in the list should be the local name of a SAML XML Element. Supported element types are AuthnRequest, LogoutRequest and LogoutResponse. Only valid if a signing certificate is also specified.
-
The SAML encryption certificate bundle URL. The bundle should be a zip file containing 'encryption.key' and 'encryption.pem' files in the directory '/saml/:id', where :id is the value of the [id] field.
-
The password to the encryption certificate bundle
-
The SSL trusted CA certificate bundle URL. The bundle should be a zip file containing a single keystore file 'keystore.ks' Note that all keys should omit the 'xpack.security.authc.realms.saml.{realm_id}' prefix. For example, when the realm ID is set to 'saml1', the advanced configuration 'xpack.security.authc.realms.saml.saml1.ssl.verification_mode: full' should be added as 'ssl.verification_mode: full'.
-
The password to the SSL certificate bundle URL truststore
-
The format of the keystore file. Should be jks to use the Java Keystore format or PKCS12 to use PKCS#12 files. The default is jks.
Values are
jks
orPKCS12
. -
Advanced configuration options in YAML format. Any settings defined here will override any configuration set via the API. Note that all keys should omit 'xpack.security.authc.realms.{realm_type}.{realm_id}'.
Responses
-
The SAML configuration was successfully updated
-
- The realm id is already in use. (code:
security_realm.id_conflict
) - The selected id is not valid. (code:
security_realm.invalid_id
) - Order must be greater than zero. (code:
security_realm.invalid_order
) - Invalid Elasticsearch Security realm type. (code:
security_realm.invalid_type
) - The realm order is already in use. (code:
security_realm.order_conflict
) - Advanced YAML format is invalid. (code:
security_realm.invalid_yaml
) - The SAML IDP metadata endpoint returned an error response code 200 OK. (code:
security_realm.saml.invalid_idp_metadata_url
) - Invalid certificate bundle URL. (code:
security_realm.invalid_bundle_url
)
- The realm id is already in use. (code:
-
The realm specified by {realm_id} cannot be found. (code:
security_realm.not_found
) -
There is a version conflict. (code:
security_realm.version_conflict
)
curl \
--request PUT 'https://{{hostname}}/api/v1/platform/configuration/security/realms/saml/{realm_id}' \
--user "username:password" \
--header "Content-Type: application/json" \
--data '{"id":"string","name":"string","idp":{"entity_id":"string","metadata_path":"string","use_single_logout":true},"sp":{"entity_id":"string","acs":"string","logout":"string"},"attributes":{"principal":"string","groups":"string","name":"string","mail":"string","dn":"string"},"nameid_format":"string","role_mappings":{"default_roles":["string"],"rules":[{"type":"username","roles":["string"],"value":"string"}]},"enabled":true,"order":42,"force_authn":true,"signing_certificate_url":"string","signing_certificate_url_password":"string","signing_saml_messages":["string"],"encryption_certificate_url":"string","encryption_certificate_url_password":"string","ssl_certificate_url":"string","ssl_certificate_url_truststore_password":"string","ssl_certificate_url_truststore_type":"jks","override_yaml":"string"}'