Repository navigation
Latchkey 0.1.0
The first release. A player types /signin and gets a one-time link, sent privately in chat, that signs their browser in to a web page. Being on the server proves who they are, so there's no password.
Needs
- Paper 26.1 or later. Paper 1.21.11 and Spigot aren't supported.
- Java 25.
online-mode=true. Latchkey refuses to make links with it off, so a server behind a proxy isn't supported yet.- A page that reads the links. Latchkey doesn't serve one itself. Leaf Juice does.
Install
- Put
Latchkey-0.1.0.jarinplugins/and start the server once. - Set the page's address in
plugins/Latchkey/config.yml. It has to start withhttps://:sign-in-page: "https://example.com"
- Restart the server.
/signinneeds thelatchkey.signinpermission, which ops have by default, and the player must be on the allowlist.
How it behaves
- A link works once and lasts two minutes. Asking again cancels the last one.
- Only a hash of the secret is written to disk, in
plugins/Latchkey/pending/. The secret comes after a#in the link, so a browser never sends it in a web request. - The link goes to whoever typed the command, so
/execute as <player> run signincan't make one for someone else. - Links left waiting are cleared when the server starts and stops.
Tested, and not
Unit tests cover how links are made and stored. Leaf Juice's real sign-in test ran this plugin on throwaway Paper 26.1.2, 26.2 and 26.3 servers with bots. It checked the permission, the allowlist, single use, that the secret stays out of the console and log, the execute as cases, and cleanup on stop.
Bots can't join an online-mode server, so those runs used -Dlatchkey.allowOfflineForTesting=true. That flag is for throwaway servers only.
Not tested yet: a real game client clicking a link, a real server, LuckPerms granting the permission (the tests used op), and Bedrock players through Geyser, who may not be able to click a chat link.
MIT licensed.