Skip to content

AUTH

Authenticates the current connection.

AUTH [username] password
ParameterTypeRequiredDescription
usernamestringNoUsername for named-user authentication
passwordstringYesPassword to authenticate with

Simple string OK on successful authentication.

Supports two authentication modes:

  • Default user mode (1 parameter): Checks the provided password against the auth.requirepass configuration value.
  • Named user mode (2 parameters): Checks the provided username and password against the auth.users.<username> configuration.

On successful authentication, the connection is marked as authenticated and stays that way until it is closed. SESSION.CLOSE does not clear it.

This command does not require the cluster to be initialized.

Argument errors:

Error CodeError messageCause
WRONGPASSinvalid username-password pair or user is disabled.-
ERRAUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?-

Default user authentication:

127.0.0.1:5484> AUTH mysecretpassword
OK

Named user authentication:

127.0.0.1:5484> AUTH admin mysecretpassword
OK

Wrong password:

127.0.0.1:5484> AUTH wrongpassword
(error) WRONGPASS invalid username-password pair or user is disabled.