1
0

oidc-logout-api.asciidoc 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. [role="xpack"]
  2. [[security-api-oidc-logout]]
  3. === OpenID Connect logout API
  4. ++++
  5. <titleabbrev>OpenID Connect 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 a refresh token and an access token that was
  13. generated as a response to a call to `/_security/oidc/authenticate`.
  14. [[security-api-oidc-logout-request]]
  15. ==== {api-request-title}
  16. `POST /_security/oidc/logout`
  17. [[security-api-oidc-logout-desc]]
  18. ==== {api-description-title}
  19. If the OpenID Connect authentication realm in {es} is accordingly configured,
  20. the response to this call will contain a URI pointing to the End Session
  21. Endpoint of the OpenID Connect Provider in order to perform Single Logout.
  22. {es} exposes all the necessary OpenID Connect related functionality via the
  23. OpenID Connect APIs. These APIs are used internally by {kib} in order to provide
  24. OpenID Connect based authentication, but can also be used by other, custom web
  25. applications or other clients. See also
  26. <<security-api-oidc-authenticate,OpenID Connect authenticate API>>
  27. and
  28. <<security-api-oidc-prepare-authentication,OpenID Connect prepare authentication API>>.
  29. [[security-api-oidc-logout-request-body]]
  30. ==== {api-request-body-title}
  31. `access_token`::
  32. (Required, string) The value of the access token to be invalidated as part of the logout.
  33. `refresh_token`::
  34. (Optional, string) The value of the refresh token to be invalidated as part of the logout.
  35. [[security-api-oidc-logout-example]]
  36. ==== {api-examples-title}
  37. The following example performs logout
  38. [source,console]
  39. --------------------------------------------------
  40. POST /_security/oidc/logout
  41. {
  42. "token" : "dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==",
  43. "refresh_token": "vLBPvmAB6KvwvJZr27cS"
  44. }
  45. --------------------------------------------------
  46. // TEST[catch:request]
  47. The following example output of the response contains the URI pointing to the
  48. End Session Endpoint of the OpenID Connect Provider with all the parameters of
  49. the Logout Request, as HTTP GET parameters:
  50. [source,js]
  51. --------------------------------------------------
  52. {
  53. "redirect" : "https://op-provider.org/logout?id_token_hint=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c&post_logout_redirect_uri=http%3A%2F%2Foidc-kibana.elastic.co%2Floggedout&state=lGYK0EcSLjqH6pkT5EVZjC6eIW5YCGgywj2sxROO"
  54. }
  55. --------------------------------------------------
  56. // NOTCONSOLE