Get a token Added in 5.5.0

POST /_security/oauth2/token

Create a bearer token for access without requiring basic authentication.

application/json

Body Required

Responses

POST /_security/oauth2/token
curl \
 -X POST http://api.example.com/_security/oauth2/token \
 -H "Content-Type: application/json" \
 -d '{"grant_type":"password","scope":"string","password":"string","kerberos_ticket":"string","refresh_token":"string","username":"string"}'
Request examples
{
  "grant_type": "password",
  "scope": "string",
  "password": "string",
  "kerberos_ticket": "string",
  "refresh_token": "string",
  "username": "string"
}
Response examples (200)
{
  "access_token": "string",
  "expires_in": 42.0,
  "scope": "string",
  "type": "string",
  "refresh_token": "string",
  "kerberos_authentication_response_token": "string",
  "": {
    "email": "string",
    "full_name": "string",
    "metadata": {
      "additionalProperty1": {},
      "additionalProperty2": {}
    },
    "roles": [
      "string"
    ],
    "username": "string",
    "enabled": true,
    "profile_uid": "string",
    "authentication_realm": {
      "name": "string",
      "type": "string"
    },
    "lookup_realm": {
      "name": "string",
      "type": "string"
    },
    "authentication_provider": {
      "type": "string",
      "name": "string"
    },
    "authentication_type": "string"
  }
}