Sign-in methods
Every way of signing in is a switch in the config, and each is off unless you turn it on. A method that’s off has no routes at all. The server refuses to start with none on.
| Method | Needs | Turn on with |
|---|---|---|
| Passkeys | public_url on a domain name (or localhost) | [auth.passkeys] enabled = true |
| Password, optionally with an authenticator app | Nothing | [auth.password] enabled = true |
| Magic link by email | SMTP | [auth.magic_link] enabled = true |
| Single sign-on | An OIDC provider | an [auth.oidc.<id>] table (OIDC) |
They can be combined: people sign in with any method their account has. The sign-in page shows
every method that’s on, and each account can add passkeys, a password and an authenticator app
from its account page (/account).
How the apps sign in
Apps don’t take passwords themselves. They open the server’s sign-in page in the system browser (or, in the web app, the page itself), and the server hands the app tokens bound to a key that never leaves the device (DPoP). So every method above works in every app, and a new method on the server needs no app update.
| Setting | Default | |
|---|---|---|
[auth] access_token_minutes | 10 | How long an app’s access token lasts before it refreshes it |
[auth] device_idle_days | 30 | A device unused this long is signed out |
[auth] device_max_days | 365 | Every device signs in again after this long |
[auth] session_hours | 12 | How long a browser stays signed in to the sign-in and account pages |
[auth] browser_idle_days / browser_max_days | 14 / 90 | The same for the web app |
People see and sign out their devices on their account page, /account.
Passkeys
[auth.passkeys]
enabled = true
Passkeys belong to public_url’s domain, so it must be a domain name, not an IP address. If you
move the server to another domain, passkeys made for the old one stop working there: keep
another method on while people add new ones.
Passwords
[auth.password]
enabled = true
# require_totp = true
Passwords are hashed with argon2id. With require_totp, every password account must also set up
an authenticator app (TOTP) before it can be used.
Magic links
[auth.magic_link]
enabled = true
# ttl_minutes = 15
[smtp]
host = "smtp.example.com"
from = "Drusite <notes@example.com>"
username = "notes@example.com"
password_file = "/run/secrets/smtp-password"
A one-time link by email, good for ttl_minutes. The server checks it can reach the SMTP server
when it starts, and stops if it can’t. See Email.
Locked out
Anyone who loses every way into their account can be let back in from the server:
drusite-server account recover someone@example.com
It prints a one-time link, valid for 30 minutes (--ttl-minutes changes that), that signs them
in once so they can add a method. Give it only to the account’s owner. A new link replaces any
unused earlier one. It doesn’t give back encrypted workspaces: those need one of their
devices or their recovery key.
Who can make an account
That’s separate from how people sign in: see Accounts, sign-up and invitations.