Self-Hostable Passkey Login Service with Safe Account Recovery for Small Apps
A self-hostable authentication service that lets small web apps offer passkey login (WebAuthn) and, more importantly, a safe account recovery path when a user loses their phone. An intermediate security final year project for developers who want phishing-resistant login without paying per monthly active user.
Intermediate
A small team, or one strong student willing to learn something new.2 semesters · 2 students
7 to ship
3 optional extrasSuggested stack
What you should ship
- A WebAuthn registration and authentication service with passkeys as the primary method, tested on at least Android, iOS, Windows and macOS browsers
- An OpenID Connect interface so any app can use it with a standard client library, with a sample app in two frameworks
- Recovery options: multiple passkeys per account, one-time recovery codes, and a delayed email recovery with a waiting period and notification to all registered devices
- A risk-based step-up rule set (new device, new country, recovery just used) that requires extra verification before sensitive actions
- An admin console listing users' registered authenticators, sign-in history and recovery events, with the ability to revoke a device
- A threat model document covering phishing, SIM swap, email takeover and helpdesk social engineering, and how each flow responds
- A test suite with virtual authenticators in headless browsers covering registration, login, recovery and revocation
If you have time left
- Passkey adoption analytics: how many users added a passkey when prompted, and where they dropped off
- Organisation accounts with admin-assisted recovery that requires two admins
- A drop-in UI component library for React and plain HTML
The problem small apps have with login
Passwords get phished, reused and stuffed. SMS codes get intercepted through SIM swap. Passkeys solve most of this: the private key never leaves the user's device and the browser only uses it on the real site, so a lookalike domain gets nothing. Major platforms now support them.
Small products, such as a school fee portal, a clinic booking app or a fintech startup's dashboard, rarely offer passkeys. The hosted identity providers that do are priced per monthly active user, which becomes painful as a consumer app grows. And every team that tries passkeys hits the same wall: what happens when the user loses their phone? If recovery is "click the email link", the account is only as safe as the email.
What already exists and the gap
- Auth0 and Clerk: hosted identity with passkey support, easy to integrate, priced per active user, with data held by the vendor.
- Hanko: an open source, passkey-first identity service that can be self-hosted under the AGPL.
- Corbado: a passkey specialist layer focused on adoption and recovery tooling on top of an existing identity provider.
- Keycloak: open source identity with WebAuthn support, powerful but heavy to run and configure for a small team.
The gap this project targets is less "another passkey server" and more recovery done carefully and documented: a small, understandable service where the recovery design, the step-up rules and the threat model are the product, and a small team can read every line.
What you build
Roles: end user, app developer (integrates via OpenID Connect), app admin.
- Sign-up: user creates an account and registers a passkey. The service prompts them to add a second passkey or save recovery codes before they leave.
- Sign-in: passkey with conditional UI (autofill), falling back to a recovery path only when needed.
- Recovery: with recovery codes, immediate. With email only, a waiting period (for example 24 hours) during which every registered device and the email are notified and can cancel.
- Step-up: after recovery or on a new device, sensitive actions in the client app (changing payout details, adding a new passkey) require extra verification.
- Admin: view and revoke authenticators, see an audit trail of sign-ins and recovery.
The technically interesting part
The engineering centre is the recovery and step-up state machine. Each account has states such as normal, recovering, recently recovered, and locked. Transitions depend on which factors were used and when. Write it as an explicit state machine with property-based tests, and show evaluators that no sequence of events lets an attacker who controls only the email take over an account without the waiting period and notifications firing.
The second interesting part is correct WebAuthn verification: challenge handling, origin and relying party ID checks, signature counter behaviour with synced passkeys, and attestation choices. Explain each decision in your report.
How to evaluate it
- Security: a written threat model with test cases for each threat; run them in CI. Invite classmates to attempt takeover of a test account with only email access, within a scoped exercise on your own deployment.
- Compatibility: a matrix of browsers and operating systems tested with real devices and virtual authenticators.
- Usability: 10 users sign up, sign in on a second device and recover a "lost" device. Measure completion rate and time.
- Performance: sign-in latency at the 95th percentile under a load test.
Suggested plan
- Weeks 1 to 4: read the WebAuthn spec and Google's passkey user journey guidance; write the threat model.
- Weeks 5 to 10: registration and authentication, OpenID Connect endpoints, sample app.
- Weeks 11 to 16: recovery state machine, step-up rules, notifications.
- Weeks 17 to 20: admin console, audit trail, Docker packaging.
- Weeks 21 to 26: compatibility testing, user study, scoped takeover exercise, write-up.
Path to a product
Release the core as open source and sell a managed hosting plan with flat pricing, or a support contract for self-hosters. The first customer is a startup or software house building consumer apps that wants phishing-resistant login and is uncomfortable with per-user pricing. Fintech and health apps, which need strong authentication and data control, are the natural next segment.
Scope warning
Do not build a full identity platform with SAML, SCIM and enterprise SSO. Do not support SMS as a recovery factor. Do not implement your own cryptography; use a well-reviewed WebAuthn library and spend your effort on flows and tests.
Learn what you need on Sefism
- Backend roadmap : sessions, tokens and API design for the auth service.
- Backend cheat sheet : quick reference while building endpoints and storage.
- OAuth 2.0 Simplified : the OAuth and OpenID Connect concepts your integration layer uses.
- OWASP ASVS : authentication and session requirements to test your service against.
- MDN: HTTP : cookies, origins and headers that matter for WebAuthn.
Get help with this idea
Scoping a security project is mostly about deciding what you will not defend against and how you will prove the rest works. If you want a second opinion on scope, stack or your evaluation plan, a mentor can review it with you; you still build it yourselves. New to Sefism? Create a free account first.
Ideas and guidance, not finished projects
These are project ideas and scoping guidance, published free for students to use as a starting point. I do not build, write, or sell final-year projects, and I do not complete coursework for anyone. Take an idea, make it yours, and build it.
Not sure this one fits you?
I help students pick an idea that matches their skills and their deadline, then scope it down until it is finishable. Guidance only, never done for you.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
Follow along
New writing, resources and project ideas land here first.