# NOAUTH error

```json metadata
{
  "schema_version": 2,
  "title": "NOAUTH error",
  "description": "The server requires a password, and the connection hasn't authenticated.",
  "categories": ["docs","develop","stack","oss","rs","rc","oss","kubernetes","clients"],
  "tableOfContents": {"sections":[{"id":"example","title":"Example"},{"id":"how-to-fix-it","title":"How to fix it"}]}

,
  "codeExamples": []
}
```


Redis returns this error when the server requires a password, but your connection hasn't sent one yet. Until the connection authenticates, the server refuses almost every command, even `PING`.

```
NOAUTH Authentication required.
```

In redis-py, this error is `AuthenticationError: Authentication required.`

If the first command is [`HELLO`](https://redis.io/docs/latest/commands/hello), the error also says how to authenticate in the same command: `NOAUTH HELLO must be called with the client already authenticated, otherwise the HELLO <proto> AUTH <user> <pass> option can be used to authenticate the client and select the RESP protocol version at the same time`.

## Example

```
> GET mykey
(error) NOAUTH Authentication required.
> AUTH <password>
OK
> GET mykey
"value"
```

## How to fix it

Authenticate before you send other commands. Use [`AUTH`](https://redis.io/docs/latest/commands/auth) with a password. If the server has access control list (ACL) users, give a username and a password: `AUTH <username> <password>`.

- **In `redis-cli`,** give the credentials when you connect: `redis-cli --user <username> --pass <password>`. To type the password at a prompt instead, use `--askpass`.
- **In a client library,** set the password, and the username if you have one, in the connection options. Most libraries also accept them in a connection URL: `redis://<username>:<password>@<host>:<port>`.

If you sent a password and got a different error, see [`WRONGPASS`](https://redis.io/docs/latest/develop/reference/errors/common/wrongpass). For more about passwords and users, see [Authentication](https://redis.io/docs/latest/operate/oss_and_stack/management/security#authentication).

