Files
elasticsearch-js/docs/reference-security-get_token.asciidoc
2024-12-05 14:46:52 -06:00

85 lines
4.2 KiB
Plaintext

[[reference-security-get_token]]
////////
===========================================================================================================================
|| ||
|| ||
|| ||
|| ██████╗ ███████╗ █████╗ ██████╗ ███╗ ███╗███████╗ ||
|| ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝ ||
|| ██████╔╝█████╗ ███████║██║ ██║██╔████╔██║█████╗ ||
|| ██╔══██╗██╔══╝ ██╔══██║██║ ██║██║╚██╔╝██║██╔══╝ ||
|| ██║ ██║███████╗██║ ██║██████╔╝██║ ╚═╝ ██║███████╗ ||
|| ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝ ||
|| ||
|| ||
|| This file is autogenerated, DO NOT send pull requests that changes this file directly. ||
|| You should update the script that does the generation, which can be found in: ||
|| https://github.com/elastic/elastic-client-generator-js ||
|| ||
|| You can run the script with the following command: ||
|| npm run elasticsearch -- --version <version> ||
|| ||
|| ||
|| ||
===========================================================================================================================
////////
[discrete]
[[client.security.getToken]]
=== client.security.getToken
Get a token. Create a bearer token for access without requiring basic authentication.
{ref}/security-api-get-token.html[{es} documentation]
[discrete]
==== Function signature
[source,ts]
----
(SecurityGetTokenRequest, options?): Promise<SecurityGetTokenResponse>
----
[discrete]
==== Request
[pass]
++++
<pre>
++++
interface SecurityGetTokenRequest extends <<RequestBase>> {
grant_type?: SecurityGetTokenAccessTokenGrantType
scope?: string
password?: <<Password>>
kerberos_ticket?: string
refresh_token?: string
username?: <<Username>>
}
[pass]
++++
</pre>
++++
[discrete]
==== Response
[pass]
++++
<pre>
++++
interface SecurityGetTokenResponse {
access_token: string
expires_in: <<long>>
scope?: string
type: string
refresh_token?: string
kerberos_authentication_response_token?: string
authentication: SecurityGetTokenAuthenticatedUser
}
[pass]
++++
</pre>
++++