2017-06-28 14:02:40 -04:00
|
|
|
[role="xpack"]
|
2017-04-06 21:04:39 -04:00
|
|
|
[[security-api-authenticate]]
|
|
|
|
=== Authenticate API
|
|
|
|
|
|
|
|
The Authenticate API enables you to submit a request with a basic auth header to
|
|
|
|
authenticate a user and retrieve information about the authenticated user.
|
|
|
|
|
2017-09-22 13:07:15 -04:00
|
|
|
|
|
|
|
==== Request
|
|
|
|
|
|
|
|
`GET _xpack/security/_authenticate`
|
|
|
|
|
|
|
|
|
|
|
|
==== Description
|
|
|
|
|
|
|
|
A successful call returns a JSON structure that shows what roles are assigned
|
|
|
|
to the user as well as any assigned metadata.
|
|
|
|
|
|
|
|
If the user cannot be authenticated, this API returns a 401 status code.
|
|
|
|
|
|
|
|
==== Examples
|
|
|
|
|
|
|
|
To authenticate a user, submit a GET request to the
|
|
|
|
`_xpack/security/_authenticate` endpoint:
|
2017-04-06 21:04:39 -04:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
GET _xpack/security/_authenticate
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
|
2017-09-22 13:07:15 -04:00
|
|
|
The following example output provides information about the "rdeniro" user:
|
2017-04-06 21:04:39 -04:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"username": "rdeniro",
|
|
|
|
"roles": [
|
|
|
|
"admin",
|
|
|
|
"kibana4"
|
2017-05-12 02:51:47 -04:00
|
|
|
],
|
|
|
|
"metadata" : {
|
|
|
|
"employee_id": "8675309"
|
|
|
|
}
|
2017-04-06 21:04:39 -04:00
|
|
|
}
|
|
|
|
--------------------------------------------------
|