Authenticate OpenID Connect

POST /_security/oidc/authenticate

Exchange an OpenID Connect authentication response message for an Elasticsearch internal access token and refresh token that can be subsequently used for authentication.

Elasticsearch exposes all the necessary OpenID Connect related functionality with the OpenID Connect APIs. These APIs are used internally by Kibana in order to provide OpenID Connect based authentication, but can also be used by other, custom web applications or other clients.

application/json

Body Required

  • nonce string Required

    Associate a client session with an ID token and mitigate replay attacks. This value needs to be the same as the one that was provided to the /_security/oidc/prepare API or the one that was generated by Elasticsearch and included in the response to that call.

  • realm string

    The name of the OpenID Connect realm. This property is useful in cases where multiple realms are defined.

  • redirect_uri string Required

    The URL to which the OpenID Connect Provider redirected the User Agent in response to an authentication request after a successful authentication. This URL must be provided as-is (URL encoded), taken from the body of the response or as the value of a location header in the response from the OpenID Connect Provider.

  • state string Required

    Maintain state between the authentication request and the response. This value needs to be the same as the one that was provided to the /_security/oidc/prepare API or the one that was generated by Elasticsearch and included in the response to that call.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
POST /_security/oidc/authenticate
curl \
 --request POST http://api.example.com/_security/oidc/authenticate \
 --header "Content-Type: application/json" \
 --data '{"nonce":"string","realm":"string","redirect_uri":"string","state":"string"}'
Request examples
{
  "nonce": "string",
  "realm": "string",
  "redirect_uri": "string",
  "state": "string"
}
Response examples (200)
{
  "access_token": "string",
  "expires_in": 42.0,
  "refresh_token": "string",
  "type": "string"
}