Sign in

How People sign in to a server from a browser or a Client App, and what a server does not do.

A Person signs in at https://<the domain>/ with an address and a password, or with a Sign-In Link. A server in Remote Access takes no password from another machine, so a browser there signs in with a link (Remote Access at home). The answer is an HTTP-only, host-only, SameSite=Strict Session cookie, and it carries Secure where the proxy reported TLS. No token appears in a URL. The CORS answer names the Public Origin and no other origin, so a page elsewhere cannot read the API with a Person's cookie. Each port also refuses a socket upgrade or a write from a browser page at another origin, so the Public Origin must be the exact address that people open.

A Sign-In Link is a one-use address of the Public Origin, https://<the domain>/sign-in#<secret>, with a QR code that a phone camera opens. The secret is in the part after #, which a browser sends to no server, so no proxy log and no Referer holds it. The page at /sign-in posts the secret to the daemon, so a message app that opens the link to make a preview does not spend it. A refused link counts against the source address, as a refused password does (ADR-0028).

Three things make a link:

  • An invite from an Administrator. When an Administrator creates a Person under People in the Administration Interface, the answer shows that Person's invite. It is good for seven days and one use. A first password is optional. New invite on the roster makes another one, for example when the first one expired. A disabled account gets no invite.
  • Another browser or app of the same Person. Under Settings → Sessions, a signed-in Person selects Sign in another browser or app. The link is good for five minutes and one use, and it signs the other browser or phone in as the same Person. The Pagis Mobile App scans the QR code with Scan a sign-in link on its Connect screen (Connect to a server).
  • pagis pair on the machine of the installation. It prints the link and its QR code in the terminal. The link is good for five minutes and one use. It is the way back in for a Person who has no Session left.

On a server, run pagis pair in the container:

docker compose exec pagis pagis pair --email grace@example.com

Without --email, the link signs in the first Administrator. The command writes the link into the records of the installation directly, so it works while the daemon runs and while it is stopped. Whoever can run it on the machine can already read those records. It refuses a disabled account.

Sessions

Settings → Sessions lists each browser and app that is signed in as the Person: the browser and its system, such as "Safari on macOS", or "Pagis on macOS" for a Client App that connected to the server, when it signed in, and when it was last used. Remove signs that browser or app out at once. A Session ends 30 days after its last use, so a client in daily use stays signed in. Sign out ends the Session of the browser that is open.

A Client App connected to this server

A Person can use the Client App instead of a browser. At setup they choose to connect to a Pagis server and enter https://<the domain>, or paste a Sign-In Link. For an address, the client opens the server's own sign-in page, where they sign in with their address and password. For a link, the client opens the page of the link, which signs it in (Connect to a server). The client installs nothing and keeps no key. It refuses a server whose release is outside its Compatibility Range (its own version and every later version that promises the same API) and says which end to update. When the server has no Administrator yet, the client says so and names the Administration Interface.

Connecting gives this server's Administrator a shell on the Person's machine. The client registers as a Host, and it runs every command the server dispatches, as the OS user that started the client. The approval lives on the server (ADR-0015). Tell each Person this before they connect.

What does not work on a server

  • Widgets. A Widget needs two loopback origins, localhost and 127.0.0.1, to isolate its frame from the Product App. A Product App on a public name has no second origin, so it shows the projection of a Widget and never the Widget (Write a Widget).
Edit on GitHub

On this page