Prepare OpenID connect authentication

POST /_security/oidc/prepare

Create an oAuth 2.0 authentication request as a URL string based on the configuration of the OpenID Connect authentication realm in Elasticsearch.

The response of this API is a URL pointing to the Authorization Endpoint of the configured OpenID Connect Provider, which can be used to redirect the browser of the user in order to continue the authentication process.

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

  • iss string

    In the case of a third party initiated single sign on, this is the issuer identifier for the OP that the RP is to send the authentication request to. It cannot be specified when realm is specified. One of realm or iss is required.

  • In the case of a third party initiated single sign on, it is a string value that is included in the authentication request as the login_hint parameter. This parameter is not valid when realm is specified.

  • nonce string

    The value used to associate a client session with an ID token and to mitigate replay attacks. If the caller of the API does not provide a value, Elasticsearch will generate one with sufficient entropy and return it in the response.

  • realm string

    The name of the OpenID Connect realm in Elasticsearch the configuration of which should be used in order to generate the authentication request. It cannot be specified when iss is specified. One of realm or iss is required.

  • state string

    The value used to maintain state between the authentication request and the response, typically used as a Cross-Site Request Forgery mitigation. If the caller of the API does not provide a value, Elasticsearch will generate one with sufficient entropy and return it in the response.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • nonce string Required
    • realm string Required
    • redirect string Required

      A URI that points to the authorization endpoint of the OpenID Connect Provider with all the parameters of the authentication request as HTTP GET parameters.

    • state string Required
POST /_security/oidc/prepare
curl \
 --request POST http://api.example.com/_security/oidc/prepare \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"iss":"string","login_hint":"string","nonce":"string","realm":"string","state":"string"}'
Request examples
{
  "iss": "string",
  "login_hint": "string",
  "nonce": "string",
  "realm": "string",
  "state": "string"
}
Response examples (200)
{
  "nonce": "string",
  "realm": "string",
  "redirect": "string",
  "state": "string"
}