# How does the client authenticate me?

The client can be used in interactive and non-interactive mode, depending on the operation being monitored by a human or not, and of course by your choice.&#x20;

**In interactive mode** (which is the default) the client will check if it has a valid authorization and, if not, will open for you a browser window so that you can log in with your credentials. After a successful login, the client will securely store an authorization token in your home folder, so that you will not need to log in for a certain amount of time. Depending on your configuration, this can vary from hours to days, but by default, a token obtained in this way will last 24 hours.&#x20;

**In non-interactive mode**, used on servers or CI/CD platforms, you will need to generate a token on the [dashboard](https://www.meterian.com/dashboard) and then store it as a file on the local file system. When you will launch the client you will have to specify where the token is stored so that the client can authenticate on your behalf.

```
$ java -jar /tmp/meterian-cli.jar --interactive=false --auth-file=/tmp/tokens/mytoken.json
```

The client also reads the environment variable **METERIAN\_API\_TOKEN** which can be preloaded with the value of the token, as visible from the [dashboard ](https://www.meterian.com/dashboard#tokens)page, in the UUID format "01234567-890a-bcde-f012-34567890abc"). We suggest to export this variable in your login script or, if running on a CI/CD platform, using the secrets configuration available there.&#x20;

<pre><code><strong>In your login script:
</strong><strong>export METERIAN_API_TOKEN=1234fd34-..."
</strong>
During normal operation:
$ java -jar /tmp/meterian-cli.jar 
</code></pre>

For detailed information please see the instructions section in your administration page.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.meterian.io/the-client/client/client-auth.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
