beetlebug▾
/

Sign in with a passkey

The web page of the daemon shows the agents and their transcripts, and sends messages. It needs a passkey: a key pair in an authenticator, such as the password manager of the browser, a security key, or a phone.

Important

The sign-in needs the command ztcl::crypto verify. No release of ztcl has it yet (ztcl pull request 1327). With a ztcl that does not have it, the page says why it refuses each sign-in.

Add the first passkey

  1. Start the daemon. It prints a one-time code:

    one-time code for the first passkey: 78986f0ca2
    
  2. Open http://localhost:7717/ in a browser on the same computer.

  3. Type the code, and click Add a passkey. The browser asks the authenticator to make a key.

  4. Click Sign in with a passkey.

The code allows one passkey and 5 tries. After 5 wrong codes, only a restart of the daemon makes a new code. A signed-in page can add one more passkey with no code.

A passkey on a phone

The browser on the computer can use a passkey on a phone through the "hybrid" sign-in of the browser: the browser shows a QR code, and the phone scans it. The phone and the computer need Bluetooth. The page stays on the computer: the daemon listens on 127.0.0.1 only, and a phone cannot open the page directly.

Note

The tests check the sign-in with the virtual authenticator of Chromium (tests/browser.mjs). The sign-in with a real phone is not tested yet.

Sign in with a shared secret

Use this way when a passkey does not work, for example when the phone refuses the passkey.

  1. Start the daemon with jcode serve --secret-login, or set "secret_login": true in the config of the state folder.
  2. The daemon makes a random secret and writes it to the file web-secret of the state folder (mode 0600). Its log names the file, not the secret.
  3. Run jcode secret to see the path of the file. Copy the secret from the file.
  4. On the sign-in page, put the secret in "Shared secret" and select "Sign in with the secret". A password manager can keep it.

A restart of the daemon keeps the same secret. jcode secret --new makes a new secret and ends each session of the page. Five wrong tries lock this way for 10 minutes.

The secret is weaker than a passkey: each copy of it can sign in. To turn it off, start the daemon with no --secret-login, and remove secret_login from the config. Then delete the file web-secret.

What the page checks

Security has the full list.