Sign-in
Sign in to the server with loot login, set the server addresses, work as a service account without a user and sign out; where loot keeps its configuration and tokens.
Signing in with the browser#
loot signs in through the sign-in service of your LooT installation (Keycloak), using the device code flow: you never type your password into the terminal, only into the browser. The flow is also convenient when the machine running loot has no browser, for example a server reached through SSH.
loot login [--server <address>] [--authority <url>] [--node-server <address>] [--ingest-server <address>]
[--query-server <address>] [--analysis-server <address>] [--dev]
[--user <name> --password <password>] [--client-id <id> --client-secret-file <file>]The first time, give the address of your installation:
$ loot login --server loot.example.org
Zum Anmelden diese Adresse im Browser öffnen und den Code bestätigen:
Adresse: https://auth.loot.example.org/realms/loot/device?user_code=OOKL-URGS
Code: OOKL-URGS
Warte auf die Bestätigung …
Angemeldet als alice.- Open the address shown in a browser, on any device.
- Sign in there with your LooT account and confirm the code.
lootnotices the confirmation and reports your name. System admins are marked with(Systemadmin).
The addresses are saved. From then on this is enough:
$ loot loginloot renews the access tokens itself as long as your sign-in session at Keycloak is valid. When it expires, simply sign in again. A sign-in replaces the previous one.
Server addresses#
A LooT installation consists of several servers. Usually --server with the common name is enough; loot then puts the service names in front:
| Service | Derived address for --server loot.example.org |
|---|---|
Sign-in (Keycloak, realm loot) | https://auth.loot.example.org/realms/loot |
| Node server (tenants, nodes, administration) | https://api.loot.example.org |
| Ingest server (writing values) | https://ingest.loot.example.org |
| Query server (reading values, live) | https://query.loot.example.org |
loot derives further services from the address of the query server when needed, by replacing query.: the analysis service (analysis.), the component server (components.) and the exchange server (exchange.). If no address can be derived, the affected commands end with a notice and exit code 2.
Rules for addresses:
- Without a scheme,
httpsapplies.httpis allowed only forlocalhostand loopback addresses. - A port is kept (
loot.example.org:8443). - The base address for
--servermust not contain a path, only the server name.
You can also set individual addresses. Values given this way override derived and previously saved ones:
| Option | Meaning |
|---|---|
--server <address> | Base address of the installation, for example loot.example.org. It yields the addresses in the table above. |
--authority <url> | Address of the Keycloak realm, for example https://auth.loot.example.org/realms/loot |
--node-server <address> | Address of the node server |
--ingest-server <address> | Address of the ingest server |
--query-server <address> | Address of the query server |
--analysis-server <address> | Address of the analysis service for loot spectrum if it cannot be derived from the query address (default: query. becomes analysis.) |
A sign-in needs the address of Keycloak and the addresses of the node, ingest and query servers. If something is missing, loot names the options required (exit code 2).
Development sign-in#
Two shortcuts exist for development environments. They are not meant for operation.
| Option | Meaning |
|---|---|
--dev | Uses the fixed addresses of the local development environment: Keycloak on port 8080, the servers on ports 7101 to 7103, the analysis service on port 7109, all on localhost. |
--user <name> and --password <password> | Signs in with user name and password (password grant). Only the development realm allows this; production installations reject it. The two options belong together. |
$ loot login --dev --user admin --password admin
Angemeldet als admin (Systemadmin).Signing in as a service account#
Services without a user, for example a script that writes values on a schedule, sign in as a service account (client credentials flow). Your administrator sets up a confidential client with a service account in Keycloak and gives you the client id and the secret.
| Option | Meaning |
|---|---|
--client-id <id> | Id of the confidential Keycloak client |
--client-secret-file <file> | File containing the client's secret. It should be readable only by your own user. |
The two options belong together and exclude --user.
$ umask 077 && printf '%s' 's3cr3t' > ~/.loot-feeder.secret
$ loot login --server loot.example.org --client-id loot-feeder --client-secret-file ~/.loot-feeder.secret
Angemeldet als loot-feeder.Good to know:
lootstores only the client id and the absolute path of the secret file, never the secret itself. Do not move or delete the file.- Before saving,
lootfetches a first token. A wrong secret or client id shows up at once, and the previous sign-in stays unchanged. - On every call
lootfetches a fresh token, so this sign-in does not expire (unlike the session of a browser sign-in). - Like a user, a service account needs membership in the tenants and permissions on the nodes (Permissions).
- The file cannot be given in the workbench console because it would live on the web server (Interactive mode and console).
- A later
loot loginwithout--client-idsigns you in as a user again and removes the service account entry.
Signing out#
loot logoutloot logout ends the session at Keycloak and deletes the saved tokens:
$ loot logout
Abgemeldet.If Keycloak cannot be reached, loot deletes the tokens anyway and reports: Lokal abgemeldet; die Sitzung bei Keycloak konnte nicht beendet werden und läuft von selbst ab. (signed out locally; the session at Keycloak could not be ended and expires on its own). For a service account, loot logout removes only the entry; your secret file is left untouched. The saved server addresses also stay, so loot login is enough afterwards.
Where loot keeps its settings#
| System | Folder |
|---|---|
| Windows | %APPDATA%\LooT |
| Linux and macOS | $XDG_CONFIG_HOME/loot, otherwise ~/.config/loot |
The environment variable LOOT_CONFIG_DIR moves the folder elsewhere, for example for separate sign-ins to several installations.
| File | Content |
|---|---|
config.json | Server addresses and, for service accounts, the client id and the path of the secret file |
tokens.bin | Your tokens. On Windows they are bound to your Windows user, otherwise file mode 0600 applies (only you). |
The workbench console needs no sign-in: it works with the account you are signed in with in the web interface. Signing in there is described in the workbench manual.