Auth and Sessions
Authentication flows live mainly in:
src/commands/auth.tssrc/client/create-client.tssrc/auth/session-store.ts
First local login
For the solo Docker quickstart, the bootstrap password is:
Q7m!Z2x@L9p#R4vK
Log in once:
Bootstrap login
liorandb login admin --password "Q7m!Z2x@L9p#R4vK"
Then rotate it immediately:
Rotate password
liorandb change-password --password "YOUR_NEW_STRONG_PASSWORD"
Login modes
The CLI supports several styles:
Login examples
liorandb login
liorandb login admin
liorandb login admin --password "super-secret"
printf 'super-secret' | liorandb login admin --password-stdin
Behavior from the source:
- interactive login can prompt for missing values
--password-stdinis supported for automation- the CLI stores the resulting refresh token after a successful login
What is stored after login
The session store persists this per profile:
refreshTokenuserIdusernamesessionIdupdatedAt
It does not store:
- your plaintext password
- access tokens
By default, sessions are written under:
~/.liorandb/state/sessions.json
You can override that root with LIORANDB_STATE_DIR.
How command authentication works
When a command needs an authenticated client, the helper in
src/client/create-client.ts does this:
- load the stored refresh token for the selected profile
- call
client.auth.refresh(...) - save the fresh login response back to the session store
- if the session has expired, try re-login from credentials embedded in the connection string
- if refresh and re-login both fail, clear stored session state
That is why the CLI can often keep working across commands without asking you to log in every time.
Session commands
Session commands
liorandb whoami
liorandb sessions
liorandb revoke-session <session-id>
liorandb logout
liorandb logout --all
Representative output:
Whoami output
{
"username": "admin",
"user_id": "01K2ADMINUSER",
"roles": ["cluster-admin"]
}
Expired sessions
If the refresh token is no longer valid:
- the CLI can clear the broken stored session
- it may recover automatically if your stored connection URL contains reusable credentials
- otherwise it will tell you to run
liorandb login
Password changes
The CLI exposes:
change-passwordfor the current authenticated useruser reset-password <id>for administrators resetting someone else
The normal bootstrap flow is:
- log in with the generated or default bootstrap password
- run
liorandb change-password - update any stored connection strings if they embed the old password
Why stdin is safer than --password
Passing passwords directly in command arguments can leak into:
- shell history
- process inspection
- pasted troubleshooting snippets
For automation, prefer:
Safer non-interactive login
printf '%s' "$LIORANDB_PASSWORD" | liorandb login admin --password-stdin