invalidate-token.asciidoc 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. --
  2. :api: invalidate-token
  3. :request: InvalidateTokenRequest
  4. :response: InvalidateTokenResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Invalidate Token API
  9. [id="{upid}-{api}-request"]
  10. ==== Invalidate Token Request
  11. The +{request}+ supports invalidating
  12. . A specific token, that can be either an _access token_ or a _refresh token_
  13. . All tokens (both _access tokens_ and _refresh tokens_) for a specific realm
  14. . All tokens (both _access tokens_ and _refresh tokens_) for a specific user
  15. . All tokens (both _access tokens_ and _refresh tokens_) for a specific user in a specific realm
  16. ===== Specific access token
  17. ["source","java",subs="attributes,callouts,macros"]
  18. --------------------------------------------------
  19. include-tagged::{doc-tests-file}[invalidate-access-token-request]
  20. --------------------------------------------------
  21. ===== Specific refresh token
  22. ["source","java",subs="attributes,callouts,macros"]
  23. --------------------------------------------------
  24. include-tagged::{doc-tests-file}[invalidate-refresh-token-request]
  25. --------------------------------------------------
  26. ===== All tokens for realm
  27. ["source","java",subs="attributes,callouts,macros"]
  28. --------------------------------------------------
  29. include-tagged::{doc-tests-file}[invalidate-realm-tokens-request]
  30. --------------------------------------------------
  31. ===== All tokens for user
  32. ["source","java",subs="attributes,callouts,macros"]
  33. --------------------------------------------------
  34. include-tagged::{doc-tests-file}[invalidate-user-tokens-request]
  35. --------------------------------------------------
  36. ===== All tokens for user in realm
  37. ["source","java",subs="attributes,callouts,macros"]
  38. --------------------------------------------------
  39. include-tagged::{doc-tests-file}[invalidate-user-realm-tokens-request]
  40. --------------------------------------------------
  41. include::../execution.asciidoc[]
  42. [id="{upid}-{api}-response"]
  43. ==== Invalidate Token Response
  44. The returned +{response}+ contains the information regarding the tokens that the request
  45. invalidated.
  46. `invalidatedTokens`:: Available using `getInvalidatedTokens` denotes the number of tokens
  47. that this request invalidated.
  48. `previouslyInvalidatedTokens`:: Available using `getPreviouslyInvalidatedTokens` denotes
  49. the number of tokens that this request attempted to invalidate
  50. but were already invalid.
  51. `errors`:: Available using `getErrors` contains possible errors that were encountered while
  52. attempting to invalidate specific tokens.
  53. ["source","java",subs="attributes,callouts,macros"]
  54. --------------------------------------------------
  55. include-tagged::{doc-tests-file}[{api}-response]
  56. --------------------------------------------------