Skip to content

10 Authentication and Tokens

Athene gives you two strong authentication patterns: persistent operator login and one-shot credentials for automation. Use persistent login for humans and PAT-based auth for CI/CD pipelines.

10.1 Prerequisites

  • PAT created in 08 Personal Access Tokens and copied to a secure store.
  • Authentication enabled on the Athene server.
  • Valid user account (alice in the examples below).

10.2 Quick Start

Step 1: Interactive login for operators

athene login

This stores CLI configuration and token under $HOME/.local/share/athene.

Step 2: Non-interactive login for scripts

printf 'alice\n' | athene login --username alice --password-stdin
athene --pat 'alice:3tRZ8nP7xQ4mL9vK2aBcD5eFgH1jN6sUyW0pQa' debian import main ./mypackage.deb

Step 4: Environment variable PAT invocation

ATHENE_PAT='alice:3tRZ8nP7xQ4mL9vK2aBcD5eFgH1jN6sUyW0pQa' athene debian import main ./mypackage.deb

Step 5: Logout when rotating contexts

athene logout

10.3 Optional Login Arguments

  • --username and --password: direct credentials for single invocations or non-interactive login.
  • --password-stdin: keeps secrets out of shell history.
  • --pat '<username>:<token>': recommended one-shot auth format for automation.
  • ATHENE_PAT: CI-friendly environment variable alternative to --pat.
  • ATHENE_USERNAME and ATHENE_PASSWORD: separate env vars when PAT is not used.
  • -I, --ignore-ssl-trust: temporary workaround for self-signed TLS labs.

Precedence rules that matter in practice:

  • Invocation arguments override environment variables.
  • One-shot credentials override saved login state.
  • PAT mode and username/password mode must not be mixed in one command.

Tip

Create dedicated automation users with least-privilege repository write access. Reusing personal admin credentials in CI is fast initially but painful to rotate and audit later.

10.4 Other Ways to Login

10.5 Next Steps

You should now have the PAT created earlier for alice and know how to use it for one-shot invocation via --pat and ATHENE_PAT.

In the next chapter, you will configure repository-level sync targets and export package content to downstream destinations.

Next chapter: 11 Sync, Export, and Distribution.