OpenSearch/x-pack/docs/en/security/authentication
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
..
active-directory-realm.asciidoc [DOCS] Merges duplicate pages for Active Directory realms (#49205) 2019-11-19 13:18:01 -08:00
anonymous-access.asciidoc [DOCS] Fixes title capitalization in security content 2018-05-14 15:36:03 -07:00
built-in-users.asciidoc [DOCS] Adds tip for elastic built-in user (#51891) 2020-02-05 18:56:23 -08:00
configuring-active-directory-realm.asciidoc [DOCS] Merges duplicate pages for Active Directory realms (#49205) 2019-11-19 13:18:01 -08:00
configuring-file-realm.asciidoc [DOCS] Merges duplicate pages for file realms (#49200) 2019-11-18 12:02:18 -08:00
configuring-kerberos-realm.asciidoc [DOCS] Remove unneeded redirects (#50476) 2019-12-26 08:29:28 -05:00
configuring-ldap-realm.asciidoc [DOCS] Merges duplicate pages for LDAP realms (#49203) 2019-11-18 14:09:24 -08:00
configuring-native-realm.asciidoc [DOCS] Merges duplicate pages for native realms (#49198) 2019-11-15 15:35:53 -08:00
configuring-pki-realm.asciidoc [DOCS] Adds PKI delegation.enabled example (#53030) 2020-03-04 14:59:45 -08:00
custom-realm.asciidoc [DOCS] Fixes link to custom realm examples (#53205) 2020-03-11 09:15:48 -07:00
file-realm.asciidoc Adjust file realm docs (#52471) (#52745) 2020-02-25 11:59:13 +02:00
index.asciidoc [DOCS] Adds intro for OIDC realm (#50485) 2019-12-30 07:05:28 -08:00
internal-users.asciidoc [DOCS] Merges security overview pages (#49342) 2019-11-19 16:19:02 -08:00
kerberos-realm.asciidoc [DOCS] Merges duplicate pages for Kerberos realms (#49207) 2019-11-18 15:23:06 -08:00
ldap-realm.asciidoc [DOCS] Merges duplicate pages for LDAP realms (#49203) 2019-11-18 14:09:24 -08:00
native-realm.asciidoc [DOCS] Merges duplicate pages for native realms (#49198) 2019-11-15 15:35:53 -08:00
oidc-guide.asciidoc [7.x] Fix responses for the token APIs (#54532) (#55278) 2020-04-16 14:05:55 +03:00
oidc-realm.asciidoc [DOCS] Adds intro for OIDC realm (#50485) 2019-12-30 07:05:28 -08:00
overview.asciidoc [DOCS] Adds missing references to oidc realms (#48224) 2019-10-29 09:41:34 -07:00
pki-realm.asciidoc [DOCS] Adds PKI delegation.enabled example (#53030) 2020-03-04 14:59:45 -08:00
realm-chains.asciidoc [DOCS] Fix realm chains example (#50568) 2020-01-14 09:01:45 -08:00
realms.asciidoc [DOCS] Adds missing references to oidc realms (#48224) 2019-10-29 09:41:34 -07:00
saml-guide.asciidoc [7.x] Switch to the most recent Kibana configuration format and SAML/OIDC endpoints. (#54624) 2020-04-02 11:59:11 +02:00
saml-realm.asciidoc [DOCS] Merges duplicate pages for SAML realms (#49209) 2019-11-18 10:09:29 -08:00
user-cache.asciidoc [DOCS] Replace "// CONSOLE" comments with [source,console] (#46679) 2019-09-13 11:44:54 -04:00