---
title: "CLI-hitelesítés | Posty dokumentáció"
description: "Böngészős bejelentkezés eszközfolyamattal, vagy API-kulcs környezeti változóban."
canonical: https://posty.hu/en/docs/cli/authentication
source: https://posty.hu/en/docs/cli/authentication.md
---

Parancssor (CLI)

# CLI-hitelesítés

Böngészős bejelentkezés eszközfolyamattal, vagy API-kulcs környezeti változóban.

## Which method to use

| Situation | Method |
| --- | --- |
| Your computer with a browser. | `posty auth:login` |
| Server, container, scheduled run, CI. | `POSTY_API_KEY` environment variable |

## Browser sign-in

```
posty auth:login
```

Kód másolása

The command opens a browser, where you approve access with a code. The CLI then stores the credential on your machine, so you don't have to put it in your scripts, and it doesn't end up in your command history.

The approval page opens even if you aren't signed in

This is intentional. If you aren't signed in, you first see **what** you are approving, including the device and code. You sign in only after that. Nothing is approved unless you sign in.

## API key via an environment variable

If there's no browser, put the API key in an environment variable. Create the key in Posty under Settings → Developers. See the [Developer settings](https://posty.hu/en/docs/settings/developers) page.

```
export POSTY_API_KEY=psty_a_kulcsod
posty integrations:list
```

Kód másolása

- Stored sign-in credentials take precedence over the environment variable.
- Pass the key through a secrets manager. Don't put it in the script or commit it to version control.
- For scheduled runs, it's also a good idea to set the `POSTY_TIMEZONE` variable so the dates are unambiguous.

## Status and logout

```
posty auth:status   # melyik munkaterülethez van kötve a gép
posty auth:logout   # a tárolt hitelesítő adat törlése
```

Kód másolása

`auth:status` doesn't just print the status. It also checks the credential with a real call. If that works, authentication is working. Any errors after that relate to the command itself.

## Your own backend

By default, the CLI connects to the posty.hu service. To connect to another instance, use the `--auth-server` flag or the `POSTY_API_URL` variable.

```
export POSTY_API_URL=https://sajat-peldany.example/api
posty auth:login --auth-server https://sajat-peldany.example/api
```

Kód másolása

Documentation pages

Is something missing from this page? Email [norbert@posty.hu](mailto:norbert@posty.hu) or use the form on the [Help](https://posty.hu/en/help) page.
