[[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 || || || || || || || =========================================================================================================================== //////// [discrete] === 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 ---- [discrete] ===== `SecurityGetTokenRequest` [source,ts] ---- interface SecurityGetTokenRequest extends <> { grant_type?: SecurityGetTokenAccessTokenGrantType scope?: string password?: <> kerberos_ticket?: string refresh_token?: string username?: <> } ---- [discrete] ===== `SecurityGetTokenResponse` [source,ts] ---- interface SecurityGetTokenResponse { access_token: string expires_in: <> scope?: string type: string refresh_token?: string kerberos_authentication_response_token?: string authentication: SecurityGetTokenAuthenticatedUser } ----