Introducing frappe-passkeys: phishing-resistant login and approvals for Frappe / ERPNext v15 and v16

Hi everyone,

We connected ERPNext directly to our banks. When a checker approves a payment in ERPNext, the money moves right away, with no second approval on the bank’s portal. That made the ERPNext approval the only thing between a payment and the bank, and password plus OTP wasn’t enough: a convincing fake login page collects the OTP as easily as the password.

Passkeys fix that. The private key never leaves the device, and the browser only uses it on the real site, so a fake page gets nothing it can replay. So we built passkey support for Frappe, for login and for confirming sensitive actions like a payment release. It has been running on our site since July. Today we’re making its first stable release available under the MIT license.

What you get

  • Passwordless login, or a passkey as the second factor after the password.
  • Passkey confirmation for your own actions. Add @passkey_protected to a whitelisted method and the user confirms with a fingerprint, face or PIN first. The confirmation is single use and bound to that user, session and the exact values, so approving ₹1,25,000 can’t be reused to send ₹9,99,999. (Custom UI)
  • Require passkeys for chosen roles, such as bank checkers, with a few grace sign-ins. Everyone else gets a gentle nudge or nothing. (Configuration)
  • A security-posture summary on the settings page that lists every way someone can still sign in without a passkey, and how to close each one.

It follows the WebAuthn Level 3 spec, has one Python dependency and no monkeypatching, and enforces everything server side. It’s laid out so it can move into Frappe core later (proposal).

Try it

bench get-app --branch version-16 https://github.com/Andrometiq/frappe-passkeys   # or version-15
bench --site yoursite install-app passkeys

Needs Frappe v15.108.0+ or v16.18.3+ and HTTPS. Every login mode ships off until you turn one on in Passkey Settings.

Try it, and please open issues on GitHub.

Engineered at Andrometiq.

Quick update: frappe-passkeys is now live on the Frappe Cloud marketplace.

If you’re on Frappe Cloud, you can now add it to your site directly.

Something I’ve been thinking about while building this

I have always believed that what we build for ourselves should be built thinking about how it would go into core. But in practice it didn’t happen much. Doing it properly for core means digging a lot deeper, and we rarely had the time for that.

Agentic development changed that for me. I don’t finish any sooner with it, but the hours I put in now go much deeper: reading the core code and the spec properly, trying the edge cases and reworking things until they hold up. This app was laid out from day one so it can move into Frappe, and I’m working towards getting passkeys into core. If and when that happens, I’ll make sure anyone using the app can move to core smoothly.

Also, building this app meant going through login in Frappe end to end, and IMO there’s a big opportunity there. Password login, email links, social login and LDAP each have their own entry point, and each handles 2FA in its own way. The app had to account for every one of them, and even a minimal version in core needs changes to the login page, 2FA and session cookie handling. I think it’s worth stepping back and looking at authentication as a whole, rather than passkeys becoming one more separate path. That’s just my opinion though, and the core team probably has context I don’t.

So, a question for anyone at Frappe reading this: is this something you’d want to look at? If yes, I’m happy to put the time in, with a written proposal first and PRs after that if it makes sense to you, built with the same care as this app. If it’s better to keep things simple for now, I’ll stick to getting passkeys in as a feature. Either is fine with me :slight_smile:

PS: Our next product, YRP, follows the same idea. It’s ERPNext with what a factory needs added on top, and we keep a list of what ERPNext would need for us to move onto it. When ERPNext ships one of those, we switch once it’s compatible and tested. Hopefully YRP ends up being just a thin layer of customizations.