OpenSearch/x-pack/docs/en/rest-api/security
Ioannis Kakavas ac87c10039
[7.x] Fix responses for the token APIs (#54532) (#55278)
This commit fixes our behavior regarding the responses we
return in various cases for the use of token related APIs.
More concretely:

- In the Get Token API with the `refresh` grant, when an invalid
(already deleted, malformed, unknown) refresh token is used in the
body of the request, we respond with `400` HTTP status code
 and an `error_description` header with the message "could not
refresh the requested token".
Previously we would return erroneously return a  `401` with "token
malformed" message.

- In the Invalidate Token API, when using an invalid (already
deleted, malformed, unknown) access or refresh token, we respond
with `404` and a body that shows that no tokens were invalidated:
   ```
   {
     "invalidated_tokens":0,
     "previously_invalidated_tokens":0,
      "error_count":0
   }
   ```
   The previous behavior would be to erroneously return
a `400` or `401` ( depending on the case ).

- In the Invalidate Token API, when the tokens index doesn't
exist or is closed, we return `400` because we assume this is
a user issue either because they tried to invalidate a token
when there is no tokens index yet ( i.e. no tokens have
been created yet or the tokens index has been deleted ) or the
index is closed.

- In the Invalidate Token API, when the tokens index is
unavailable, we return a `503` status code because
we want to signal to the caller of the API that the token they
tried to invalidate was not invalidated and we can't be sure
if it is still valid or not, and that they should try the request
again.

Resolves: #53323
2020-04-16 14:05:55 +03:00
..
authenticate.asciidoc
change-password.asciidoc [DOCS] Merges duplicate pages for native realms (#49198) 2019-11-15 15:35:53 -08:00
clear-cache.asciidoc
clear-roles-cache.asciidoc [DOCS] Merges duplicate pages for native realms (#49198) 2019-11-15 15:35:53 -08:00
create-api-keys.asciidoc [DOCS] Remove unneeded redirects (#50476) 2019-12-26 08:29:28 -05:00
create-role-mappings.asciidoc Validate role templates before saving role mapping (#52636) (#54059) 2020-03-24 20:43:59 +11:00
create-roles.asciidoc
create-users.asciidoc [DOCS] Merges duplicate pages for native realms (#49198) 2019-11-15 15:35:53 -08:00
delegate-pki-authentication.asciidoc
delete-app-privileges.asciidoc
delete-role-mappings.asciidoc
delete-roles.asciidoc
delete-users.asciidoc [DOCS] Merges duplicate pages for native realms (#49198) 2019-11-15 15:35:53 -08:00
disable-users.asciidoc [DOCS] Merges duplicate pages for native realms (#49198) 2019-11-15 15:35:53 -08:00
enable-users.asciidoc [DOCS] Merges duplicate pages for native realms (#49198) 2019-11-15 15:35:53 -08:00
get-api-keys.asciidoc Fix section header in Get API key information API doc (#51807) 2020-02-03 07:36:18 -08:00
get-app-privileges.asciidoc
get-builtin-privileges.asciidoc Add "grant_api_key" cluster privilege (#54042) 2020-03-24 13:17:45 +11:00
get-role-mappings.asciidoc
get-roles.asciidoc
get-tokens.asciidoc
get-users.asciidoc [DOCS] Merges duplicate pages for native realms (#49198) 2019-11-15 15:35:53 -08:00
has-privileges.asciidoc
invalidate-api-keys.asciidoc
invalidate-tokens.asciidoc
oidc-authenticate-api.asciidoc [7.x] Switch to the most recent Kibana configuration format and SAML/OIDC endpoints. (#54624) 2020-04-02 11:59:11 +02:00
oidc-logout-api.asciidoc [7.x] Fix responses for the token APIs (#54532) (#55278) 2020-04-16 14:05:55 +03:00
oidc-prepare-authentication-api.asciidoc
put-app-privileges.asciidoc [DOCS] Fixes endpoint schema in PUT app privileges API docs. (#49390) 2019-11-21 09:52:44 +01:00
role-mapping-resources.asciidoc
saml-authenticate-api.asciidoc [7.x] Return realm name in SAML Authenticate API (#52188) (#52465) 2020-02-18 17:16:24 +02:00
saml-invalidate-api.asciidoc
saml-logout-api.asciidoc
saml-prepare-authentication-api.asciidoc
ssl.asciidoc