Paul Bădărău

Passwordless authentication: what it fixes and costs

Passwordless authentication removes a bad first barrier, but email delivery, shared inboxes and expiry rules still need product and security decisions.

The client portal didn't need self-serve registration, a password policy, or a forgotten-password queue; it needed someone at a property customer to open an invoice, download a report, and see only their organisation's records. I built it with an email one-time passcode through Postmark, entered in the same browser to start a session scoped to that client's properties, inspections, reports, and invoices.

On a platform with over 25,000 properties, 60,000 inspections, and 17 million attachments, a portal user might log in twice a year to grab an invoice. Making them invent and remember a password for that creates friction before the product has given them anything back.

A portal login should match the job the person came to do

The old invoice page used a shared access-code session, which was tolerable until the portal started carrying inspection reports and property history that shouldn't stay open to anyone forwarding an email thread. The replacement ties identity to a client relationship: proving someone reads [email protected] shows they control that mailbox, while the client relationship still decides which records they can see.

Once the one-time code verifies, the session resolves to a portal user and scopes queries at load time to their assigned properties, reports, invoice PDFs, and ZIP bundles. Permissions get expensive when they're bolted on late, because links get copied and URLs get edited by hand; the server has to reject another client's document on every request, even if the UI already hides it.

I learned how separate login and authorisation really are on a social-care platform where carers, team-scoped administrators, and super-administrators each saw different data, alongside public sharing slugs that could be deactivated at any time. Most portals don't need that complexity, yet a passwordless login won't fix access rules you haven't written down.

Passwords add work before they add trust

Passwords look simple at first. Then you have to build hashing, reset emails, token expiry, password-change screens, lockout rules, breach checks, and support for people who lose both their email and their password. On this portal, the client's work email is already on file, so six months later there's no forgotten secret to guess three times before a lockout.

Passwordless also doesn't mean open signup. Here, an email only works if it resolves to an existing portal user set up by the agency, and the common anti-pattern of making someone verify an email only to send them back to a login form is skipped altogether. You trade away password storage and reuse risk, and in return the security boundary moves to the mailbox, code lifetime, rate limits, unknown-address handling, and permission mapping.

Email delivery becomes part of the login path

With email OTP, Postmark sits on the critical path of login, so delayed or filtered mail blocks access directly. The email has to look transactional, come from a recognised domain, and state the expiry in plain language. Resends also need clear rules so a user clicking twice doesn't end up with five valid codes and confusion over which one works.

To avoid leaking which addresses are registered, the public form returns a neutral acknowledgement on unknown emails while logging failed attempts internally and giving staff a way to check whether a portal user exists. Rate limits per address and per IP, short code lifetimes, enough entropy, and a cap on failed guesses keep someone from flooding an inbox or brute-forcing a code. When the mail provider has an outage, existing sessions keep working while new email logins wait, which is acceptable for occasional invoices if delivery is monitored and support has a fallback.

Magic links work well on a desktop where the mail client and browser live together, yet they break constantly on mobile. A user requests a link in Safari, taps the email, and the mail app opens the link inside its own embedded browser, leaving them signed in there while the original tab is still waiting. That's not user error.

Email OTP keeps the flow in the browser where it started, and modern mobile keyboards autofill the code from the notification. Neither links nor codes solve shared inboxes like finance@ or property@. If a client needs per-person audit logs or clean offboarding when someone leaves, you need named user accounts managed by the client, because a shared mailbox never identifies an individual.

Passwords are still correct in some products

Passwords still make sense when staff don't have personal email on shift, when users work daily on managed devices, or when high-risk actions need a second factor. On that social-care platform, administrator accounts required a separate two-factor gate because they managed profiles and sharing links. Passkeys are strong for consumer products too, provided you plan device loss and recovery, while internal apps behind single sign-on should use the organisation's identity provider instead of building a second password database.

Test authentication through to document access

Good auth tests cover code generation and expiry, session rotation, sign-out, rate limits, cross-client document blocks, and what happens when a user is removed or changes email. On the property platform, invoice PDFs are fetched through the agency's authenticated Xero connection and streamed from the Rails app after checking client ownership, never exposed as raw Xero URLs.

Keeping authentication inside Rails puts those permission rules right next to the data they protect instead of splitting them across a third-party dashboard and frontend code. For the rest of the setup that keeps a portal like this small enough to run solo, read my Rails stack.