# Authentication

Users must log in to sui.direct in order to perform read/write actions, like pushing your code in a repository.

You can log in to CLI with this command:

```
direct auth login
```

Then you will need to sign a message with the wallet you provide.

And if you want to log out,

```
direct auth logout
```

From a technical view, authentication for users is simple.

1. CLI and Node handshakes, CLI sends its peer ID to Node
2. CLI sends a nonce to Node
3. User signs a signature, and CLI sends it to Node
4. Node validates the signature with the nonce and peer ID
5. Node generates a JWT token and sends it to the CLI
6. CLI stores it in the `~/sui.direct/TOKEN` file located in the home directory.

<figure><img src="https://1570825343-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7bKuvkVhOG7Q0XCC8MRr%2Fuploads%2FZd5NjHrBVqlfC40op9oQ%2FNode%20(1).png?alt=media&#x26;token=c9a13366-872b-4b9f-b136-491d7f267b7a" alt=""><figcaption><p>Authenticaion Sequence Diagram</p></figcaption></figure>

To get started with how to log in to sui.direct CLI, follow the next tutorial.

{% content-ref url="authentication/slush-wallet" %}
[slush-wallet](https://docs.sui.direct/cli/authentication/slush-wallet)
{% endcontent-ref %}
