oidc-logout-api.asciidoc 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. [role="xpack"]
  2. [[security-api-oidc-logout]]
  3. === OpenID Connect logout API
  4. Submits a request to invalidate a refresh token and an access token that was
  5. generated as a response to a call to `/_security/oidc/authenticate`.
  6. [[security-api-oidc-logout-request]]
  7. ==== {api-request-title}
  8. `POST /_security/oidc/logout`
  9. [[security-api-oidc-logout-desc]]
  10. ==== {api-description-title}
  11. If the OpenID Connect authentication realm in {es} is accordingly configured,
  12. the response to this call will contain a URI pointing to the End Session
  13. Endpoint of the OpenID Connect Provider in order to perform Single Logout.
  14. {es} exposes all the necessary OpenID Connect related functionality via the
  15. OpenID Connect APIs. These APIs are used internally by {kib} in order to provide
  16. OpenID Connect based authentication, but can also be used by other, custom web
  17. applications or other clients. See also
  18. <<security-api-oidc-authenticate,OpenID Connect authenticate API>>
  19. and
  20. <<security-api-oidc-prepare-authentication,OpenID Connect prepare authentication API>>.
  21. [[security-api-oidc-logout-request-body]]
  22. ==== {api-request-body-title}
  23. `access_token`::
  24. The value of the access token to be invalidated as part of the logout.
  25. `refresh_token`::
  26. (Optional) The value of the refresh token to be invalidated as part of the logout.
  27. [[security-api-oidc-logout-example]]
  28. ==== {api-examples-title}
  29. The following example performs logout
  30. [source,js]
  31. --------------------------------------------------
  32. POST /_security/oidc/logout
  33. {
  34. "token" : "dGhpcyBpcyBub3QgYSByZWFsIHRva2VuIGJ1dCBpdCBpcyBvbmx5IHRlc3QgZGF0YS4gZG8gbm90IHRyeSB0byByZWFkIHRva2VuIQ==",
  35. "refresh_token": "vLBPvmAB6KvwvJZr27cS"
  36. }
  37. --------------------------------------------------
  38. // CONSOLE
  39. // TEST[catch:unauthorized]
  40. The following example output of the response contains the URI pointing to the
  41. End Session Endpoint of the OpenID Connect Provider with all the parameters of
  42. the Logout Request, as HTTP GET parameters:
  43. [source,js]
  44. --------------------------------------------------
  45. {
  46. "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"
  47. }
  48. --------------------------------------------------
  49. // NOTCONSOLE