|
| 1 | +[role="xpack"] |
| 2 | +[[security-api-saml-sp-metadata]] |
| 3 | +=== SAML sp metadata API |
| 4 | + |
| 5 | +Generate a SAML 2.0 Service Provider Metadata. |
| 6 | + |
| 7 | +[[security-api-saml-sp-metadata-request]] |
| 8 | +==== {api-request-title} |
| 9 | + |
| 10 | +`POST /_security/saml/metadata/<realmname>` |
| 11 | + |
| 12 | +[[security-api-saml-sp-metadata-desc]] |
| 13 | +==== {api-description-title} |
| 14 | + |
| 15 | +The SAML 2.0 specification provides a mechanism for Service Providers to describe their |
| 16 | +capabilities and configuration using a metadata file. |
| 17 | +This API generates Service Provider metadata, based on the configuration of a SAML realm |
| 18 | +in Elasticsearch. |
| 19 | + |
| 20 | +[[security-api-saml-sp-metadata-response-body]] |
| 21 | +==== {api-response-body-title} |
| 22 | + |
| 23 | +`metadata`:: |
| 24 | +(string) An XML string that contains a SAML Service Providers metadata for the realm. |
| 25 | + |
| 26 | +[[security-api-saml-sp-metadata-example]] |
| 27 | +==== {api-examples-title} |
| 28 | + |
| 29 | +The following example generate Service Provider metadata for |
| 30 | +SAML realm `saml1`: |
| 31 | + |
| 32 | +[source,console] |
| 33 | +-------------------------------------------------- |
| 34 | +GET /_security/saml/metadata/saml1 |
| 35 | +-------------------------------------------------- |
| 36 | +The API returns the following response: |
| 37 | + |
| 38 | +[source,js] |
| 39 | +-------------------------------------------------- |
| 40 | +{ |
| 41 | + "xml_metadata":"<?xml version=\"1.0\" encoding=\"UTF-8\"?><md:EntityDescriptor xmlns:md=\"urn:oasis:names:tc:SAML:2.0:metadata\" entityID=\"https://kibana.example.com/\">\n <md:SPSSODescriptor AuthnRequestsSigned=\"false\" WantAssertionsSigned=\"true\" protocolSupportEnumeration=\"urn:oasis:names:tc:SAML:2.0:protocol\">\n <md:SingleLogoutService Binding=\"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect\" Location=\"https://kibana.example.com/logout\"/>\n <md:AssertionConsumerService Binding=\"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST\" Location=\"https://kibana.example.com/api/security/v1/saml\" index=\"1\" isDefault=\"true\"/>\n </md:SPSSODescriptor>\n</md:EntityDescriptor>\n" |
| 42 | +} |
| 43 | +-------------------------------------------------- |
0 commit comments