1
0

saml-complete-logout-api.asciidoc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. [role="xpack"]
  2. [[security-api-saml-complete-logout]]
  3. === SAML complete logout API
  4. ++++
  5. <titleabbrev>SAML complete logout</titleabbrev>
  6. ++++
  7. .New API reference
  8. [sidebar]
  9. --
  10. For the most up-to-date API details, refer to {api-es}/group/endpoint-security[Security APIs].
  11. --
  12. Verifies the logout response sent from the SAML IdP.
  13. NOTE: This API is intended for use by custom web applications other than {kib}.
  14. If you are using {kib}, see the <<saml-guide-stack>>.
  15. [[security-api-saml-complete-logout-request]]
  16. ==== {api-request-title}
  17. `POST /_security/saml/complete_logout`
  18. [[security-api-saml-complete-logout-desc]]
  19. ==== {api-description-title}
  20. The SAML IdP may send a logout response back to the SP after handling
  21. the <<security-api-saml-logout,SP-initiated SAML Single Logout>>.
  22. This API verifies the response by ensuring the content is relevant
  23. and validating its signature. An empty response is returned if
  24. the verification process is successful.
  25. The response can be sent by the IdP with either the HTTP-Redirect or
  26. the HTTP-Post binding. The caller of this API must prepare the request
  27. accordingly so that this API can handle either of them.
  28. {es} exposes all the necessary SAML related functionality via the SAML APIs.
  29. These APIs are used internally by {kib} in order to provide SAML based
  30. authentication, but can also be used by other custom web applications or other
  31. clients. See also <<security-api-saml-authenticate,SAML authenticate API>>,
  32. <<security-api-saml-prepare-authentication,SAML prepare authentication API>>,
  33. <<security-api-saml-invalidate,SAML invalidate API>>, and
  34. <<security-api-saml-logout,SAML logout API>>.
  35. [[security-api-saml-complete-logout-request-body]]
  36. ==== {api-request-body-title}
  37. `realm`::
  38. (Required, string) The name of the SAML realm in {es} for which the configuration is
  39. used to verify the logout response.
  40. `ids`::
  41. (Required, array) A json array with all the valid SAML Request Ids that the caller of
  42. the API has for the current user.
  43. `query_string`::
  44. (Optional, string) If the SAML IdP sends the logout response with the HTTP-Redirect
  45. binding, this field must be set to the query string of the redirect URI.
  46. `queryString`::
  47. deprecated:[7.14.0, "Use query_string instead"]
  48. See `query_string`
  49. `content`::
  50. (Optional, string) If the SAML IdP sends the logout response with the HTTP-Post
  51. binding, this field must be set to the value of the `SAMLResponse` form parameter
  52. from the logout response.
  53. [[security-api-saml-complete-logout-example]]
  54. ==== {api-examples-title}
  55. The following example verifies the logout response sent by the SAML IdP
  56. using the HTTP-Redirect binding:
  57. [source,console]
  58. --------------------------------------------------
  59. POST /_security/saml/complete_logout
  60. {
  61. "realm": "saml1",
  62. "ids": [ "_1c368075e0b3..." ],
  63. "query_string": "SAMLResponse=fZHLasMwEEVbfb1bf...&SigAlg=http%3A%2F%2Fwww.w3.org%2F2000%2F09%2Fxmldsig%23rsa-sha1&Signature=CuCmFn%2BLqnaZGZJqK..."
  64. }
  65. --------------------------------------------------
  66. // TEST[skip:can't test this without a valid SAML Logout Response]
  67. If the logout response is sent with the HTTP-Post binding, it can be verified
  68. as the follows:
  69. [source,console]
  70. --------------------------------------------------
  71. POST /_security/saml/complete_logout
  72. {
  73. "realm": "saml1",
  74. "ids": [ "_1c368075e0b3..." ],
  75. "content": "PHNhbWxwOkxvZ291dFJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46..."
  76. }
  77. --------------------------------------------------
  78. // TEST[skip:can't test this without a valid SAML Logout Response]
  79. The API returns an empty response on success.