auth-passkeys
WebAuthn registration and login, verified in pure Rust. No password to phish, and no account left without a way in.
As a git dependency
cargo add cratefield-auth-passkeys --git https://github.com/Cratefield/harnessIn the repository, not on crates.io yet.
What it is
auth-passkeys.
A passkey is registered against a signed-in session and used to log in without one. The registration options carry the relying party, the user handle, the algorithms accepted and the credentials to exclude; login options carry a challenge, and with an email the account's credential ids, otherwise an empty list so a discoverable credential can answer.
The rule worth naming is on the delete route: a passkey cannot be removed when it is the account's only way in. An account with no credential left is not a tidier account, it is a locked-out person with a support ticket.
Ports
Database · Clock · IdGen · Signer
Routes
/v1/auth-passkeys
- /register
- POST
/v1/auth-passkeys/register/ options - POST
/v1/auth-passkeys/register/ verify - /login
- POST
/v1/auth-passkeys/login/ options - POST
/v1/auth-passkeys/login/ verify - /credentials
- GET
/v1/auth-passkeys/credentials - DELETE
/v1/auth-passkeys/credentials/ {id}
History
Changelog.
Not released on its own: it is taken from the repository as a git dependency, and has no CHANGELOG.md yet.
Google and Apple both arrive over OpenID Connect in auth-oidc. Facebook, email and password and magic links are crates of their own.