saml-logout-api.asciidoc 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. [role="xpack"]
  2. [[security-api-saml-logout]]
  3. === SAML logout API
  4. ++++
  5. <titleabbrev>SAML 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. Submits a request to invalidate an access token and refresh token.
  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-logout-request]]
  16. ==== {api-request-title}
  17. `POST /_security/saml/logout`
  18. [[security-api-saml-logout-desc]]
  19. ==== {api-description-title}
  20. This API invalidates the tokens that were generated for a user by the
  21. <<security-api-saml-authenticate,SAML authenticate API>>.
  22. If the SAML realm in {es} is configured accordingly and the SAML IdP supports
  23. this, the {es} response contains a URL to redirect the user to the IdP
  24. that contains a SAML logout request (starting an SP-initiated SAML Single Logout).
  25. {es} exposes all the necessary SAML related functionality via the SAML APIs.
  26. These APIs are used internally by {kib} in order to provide SAML based
  27. authentication, but can also be used by other custom web applications or other
  28. clients. See also <<security-api-saml-authenticate,SAML authenticate API>>,
  29. <<security-api-saml-prepare-authentication,SAML prepare authentication API>>,
  30. <<security-api-saml-invalidate,SAML invalidate API>>, and
  31. <<security-api-saml-complete-logout, SAML complete logout API>>.
  32. [[security-api-saml-logout-request-body]]
  33. ==== {api-request-body-title}
  34. `token`::
  35. (Required, string) The access token that was returned as a response to calling the
  36. <<security-api-saml-authenticate,SAML authenticate API>>. Alternatively, the most
  37. recent token that was received after refreshing the original one by using a
  38. `refresh_token`.
  39. `refresh_token`::
  40. (Optional, string) The refresh token that was returned as a response to calling the
  41. <<security-api-saml-authenticate,SAML authenticate API>>. Alternatively, the
  42. most recent refresh token that was received after refreshing the original access token.
  43. [[security-api-saml-logout-response-body]]
  44. ==== {api-response-body-title}
  45. `redirect`::
  46. (string) A URL that contains a SAML logout request as a parameter. The user
  47. can use this URL to be redirected back to the SAML IdP and to initiate Single
  48. Logout.
  49. [[security-api-saml-logout-example]]
  50. ==== {api-examples-title}
  51. The following example invalidates the pair of tokens that were generated by
  52. calling the <<security-api-saml-authenticate,SAML authenticate API>>
  53. with a successful SAML response:
  54. [source,console]
  55. --------------------------------------------------
  56. POST /_security/saml/logout
  57. {
  58. "token" : "46ToAxZVaXVVZTVKOVF5YU04ZFJVUDVSZlV3",
  59. "refresh_token" : "mJdXLtmvTUSpoLwMvdBt_w"
  60. }
  61. --------------------------------------------------
  62. // TEST[skip:can't test this without a valid SAML Response]
  63. The API returns the following response:
  64. [source,js]
  65. --------------------------------------------------
  66. {
  67. "redirect" : "https://my-idp.org/logout/SAMLRequest=...."
  68. }
  69. --------------------------------------------------
  70. // NOTCONSOLE