Kaiyichen xp — Visual Designer

For the best experience
Enter Full Screen (F11)

Portfolio®︎

Kaiyichen XP

繁體中文 English 简体中文 한국어 日本語 ภาษาไทย

Passwordless Kanboard Login: I Built a Zero-Dependency Passkey Plugin

Kaiyi Chen ·

I built a Passkey plugin for self-hosted Kanboard. It supports passwordless login and can replace one-time passwords as a second factor. This is why it has no Composer dependency, how it preserves TOTP, the setup traps, and installation.

I run my work on a self-hosted Kanboard. The board is not what usually slows me down; logging in is. Moving to another computer means entering a password again, and two-step verification means finding the six-digit code on my phone.

Kanboard core has no passkey support, so I built a zero-dependency plugin. It adds passwordless login and lets each user choose passkeys as a replacement for a one-time password as the second factor. The source is on GitHub under the MIT license.

What Passkey changes

Passkey is a way to use WebAuthn. A device creates a key pair; the site stores the public key while the private key stays on the device or a sync service. During login, the device asks for a fingerprint, face scan, or PIN and signs a random challenge from the site.

A database leak does not reveal a password that can be used to log in. A passkey is also tied to the site’s domain, so a phishing site cannot use it. Possessing the device and unlocking it normally provide two factors.

The plugin adds a “Sign in with passkey” button. Supported browsers can also offer credentials directly in the username field. Users can register multiple passkeys and choose whether to use one as their second factor.

Why avoid a library

In a normal PHP project I would use a mature WebAuthn library. Kanboard plugins, however, are often installed by extracting a zip or using a URL in the admin screen. I cannot assume that the host has a shell or Composer, and bundling vendor brings dependency updates and conflicts with other plugins.

I implemented only what this plugin needs: CBOR decoding, public-key conversion, authenticator-data parsing, and registration and login flows. OpenSSL and libsodium handle the signatures. The result needs PHP 8.1 and ext-openssl; Ed25519 additionally needs ext-sodium.

I do not validate attestation. It identifies the brand of authenticator, not whether the user is the right person, and full validation would require maintaining FIDO metadata.

Preserve one-time passwords

The hard part was not passwordless login but the second factor. Kanboard uses one post-authentication provider. Registering a passkey provider directly could replace TOTP and lock out everyone who had not selected passkeys.

The plugin therefore sits in front of TOTP. Users who chose passkeys use WebAuthn; everyone else is handed back to Kanboard’s original TOTP flow. The result still goes through the core second-factor screen.

A passkey login has already completed two factors, so it is not asked again. One-time-password users keep the original flow. Removing the last passkey also disables the second factor, so a user cannot lock themselves out.

Traps I hit

The relying party ID is a hostname such as kanboard.example.com. Allowed origins are full origins such as https://kanboard.example.com. Leaving out https:// makes registration and login fail, with an error that is not very helpful.

Changing the RP ID invalidates every registered passkey, so decide it before users start registering. WebAuthn is available only on HTTPS or localhost; on plain HTTP the button can look as if it does nothing.

Synced passkeys can always report a counter of zero. Zero cannot be checked like a normal counter; when it is non-zero, it must be greater than the previous value.

Installation and use

The requirements are Kanboard 1.2.0 or later, PHP 8.1 or later, and ext-openssl. Ed25519 authenticators also need ext-sodium. SQLite, MySQL, and PostgreSQL are supported.

The plugin directory must be plugins/Passkey:

git clone https://github.com/heykaiyi/kanboard-passkey.git Passkey

Run that command inside Kanboard’s plugins/ directory, or extract the zip so the folder is still named Passkey. Then open “Settings → Passkeys” to check the RP ID and allowed origins. Users register a device from the Passkeys page in their profile.

When a passkey exists, the login page shows the button. To use it as the second factor, enable it on the same page. The page warns that the existing TOTP secret will be removed.

Tests and limits

The cryptographic verification is tested with plain PHP scripts and does not require Composer. The tests generate real keys and signatures and cover invalid origins, challenges, tampered signatures, replayed registration responses, and incorrect counters. A second set runs inside Kanboard to confirm that TOTP users still follow the original path.

The most time-consuming part was connecting to Kanboard’s authentication flow without affecting users who did not choose passkeys. Zero dependencies make installation simple, but they also put the WebAuthn verification responsibility inside this plugin, so rejection cases need to keep being tested.

Plugin Development #Kanboard #Passkey