Authenticate a user Added in 5.5.0

GET /_security/_authenticate

Authenticates a user and returns information about the authenticated user. Include the user information in a basic auth header. A successful call returns a JSON structure that shows user information such as their username, the roles that are assigned to the user, any assigned metadata, and information about the realms that authenticated and authorized the user. If the user cannot be authenticated, this API returns a 401 status code.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • api_key object
      Hide api_key attributes Show api_key attributes object
      • id string Required
      • name string
    • authentication_realm object Required
      Hide authentication_realm attributes Show authentication_realm attributes object
      • name string Required
      • type string Required
    • full_name string | null

    • lookup_realm object Required
      Hide lookup_realm attributes Show lookup_realm attributes object
      • name string Required
      • type string Required
    • metadata object Required
      Hide metadata attribute Show metadata attribute object
      • * object Additional properties
    • roles array[string] Required
    • username string Required
    • enabled boolean Required
    • authentication_type string Required
    • token object
      Hide token attributes Show token attributes object
      • name string Required
      • type string
GET /_security/_authenticate
GET /_security/_authenticate
curl \
 --request GET 'http://api.example.com/_security/_authenticate' \
 --header "Authorization: $API_KEY"
Response examples (200)
A successful response from `GET /_security/_authenticate`.
{
  "username": "rdeniro",
  "roles": [
    "admin"
  ],
  "full_name": null,
  "email":  null,
  "metadata": { },
  "enabled": true,
  "authentication_realm": {
    "name" : "file",
    "type" : "file"
  },
  "lookup_realm": {
    "name" : "file",
    "type" : "file"
  },
  "authentication_type": "realm"
}