xpack.security.authenticate

edit
client.xpack.security.authenticate()

Reference