OpenSearch/docs/en/rest-api/security/authenticate.asciidoc
Lisa Cawley 08fdac5a93 [DOCS] Move security APIs to Elasticsearch Ref (elastic/x-pack-elasticsearch#1877)
* [DOCS] Move security APIs to Elasticsearch Ref

* [DOCS] Update links to security APIs

* [DOCS] Fix link to security APIs

Original commit: elastic/x-pack-elasticsearch@d7a9d3f1ab
2017-06-28 11:02:40 -07:00

33 lines
905 B
Plaintext

[role="xpack"]
[[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.
Returns a 401 status code if the user cannot be authenticated.
To authenticate a user, submit a GET request to the `_xpack/security/_authenticate` endpoint:
[source,js]
--------------------------------------------------
GET _xpack/security/_authenticate
--------------------------------------------------
// CONSOLE
A successful call returns a JSON structure that shows what roles are assigned
to the user as well as any assigned metadata.
[source,js]
--------------------------------------------------
{
"username": "rdeniro",
"roles": [
"admin",
"kibana4"
],
"metadata" : {
"employee_id": "8675309"
}
}
--------------------------------------------------