Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.

MethodNeedsTurn on with
Passkeyspublic_url on a domain name (or localhost)[auth.passkeys] enabled = true
Password, optionally with an authenticator appNothing[auth.password] enabled = true
Magic link by emailSMTP[auth.magic_link] enabled = true
Single sign-onAn OIDC provideran [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.

SettingDefault
[auth] access_token_minutes10How long an app’s access token lasts before it refreshes it
[auth] device_idle_days30A device unused this long is signed out
[auth] device_max_days365Every device signs in again after this long
[auth] session_hours12How long a browser stays signed in to the sign-in and account pages
[auth] browser_idle_days / browser_max_days14 / 90The 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.

[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.