Day one: forty lines of code
Email, password, hash it, store it, compare on login. Clean and done.
That’s exactly why every team starts here, and why auth looks like something you can knock out in an afternoon.
Dozens of B2B teams told us the same story. It starts as a simple login page. Then real traffic runs through it, and it quietly becomes identity infrastructure: the foundation your whole product stands on.

Every homegrown auth starts as a handful of lines. The trouble starts after launch, when each small decision quietly hardens into the model your whole product assumes is true.
Email, password, hash it, store it, compare on login. Clean and done.
That’s exactly why every team starts here, and why auth looks like something you can knock out in an afternoon.
Who counts as a user. Which organization they belong to. Which session is still trustworthy. How access gets pulled back.
Rate limits, MFA and its recovery flow, sessions, refresh tokens, an organization model that’s far more than an is_admin boolean. Every answer you ship becomes a rule the product now silently assumes.
Swapping the login page on paper meant rebuilding the identity foundation in code.
One 20-year SaaS tried to move to email-as-username. Permission checks lived in hundreds of modules. Nobody would sign off, so it dragged on until it couldn’t.
It logs people in for years without an incident. Then one business change turns “enough” into “in the way” overnight. These three arrive for almost every product that scales.
The first big deal lands and procurement wants SSO through their own Entra or Google Workspace. Then both SAML and OIDC, because the next customer runs something else. Every customer’s identity setup is different, and almost none of the work carries over.
Learn more
Split by organization, split by product, often inherited through acquisitions. “Unify identity” sounds like a feature; in code it means redefining what counts as one user and one organization.
Learn more
It’s no longer just people in a browser. Agents, MCP servers, and command lines all claim to act for some user. And your auth only knows how to log a person into a page.
Learn more
The first version is cheap: a few engineers, a few weeks, out the door. Then you feed it every year with the engineering time that belonged in your core product.
You never get an invoice that says “authentication.”
You pay in person-months, slipped deadlines, security debt, and rework. One membership organization built their own to dodge a license fee; five years on, maintaining it had cost more than buying ever would.
The critical context lives in someone’s head, not the docs.
Which customer is configured how, why a past migration was done a certain way. When that person is out, the enterprise pipeline stalls. When they leave, it walks out the door with them.
No customer pays you a cent more because you wrote your own OAuth server.
Auth has to be reliable. But “reliable” isn’t the same as “built by you.” For most products it’s a core dependency, not a core differentiator. Those two are a long way apart.
Most mature auth already covers the features: SSO, MFA, organizations, unified login, agent access. The real difference is whether you can leave. Don’t climb out of your own few thousand lines just to get locked into someone else’s.
OIDC, OAuth, and RS256-signed JWTs you already understand. Read claims straight from an ordinary token, with no vendor-specific API to learn.
If it’s open source and self-hostable, you can leave whenever you want. Don’t trade your own custom system for a hosted one you can’t exit either.
Charging by registered users or monthly actives follows a table that only grows. At scale that’s a growth tax, the exact thing that pushes teams to build their own.
Export user data whenever you want. And handing this sensitive data to a specialist spares you the risk of guarding a pile of PII you were never the right party to hold.
Logto is open source, self-hostable, and also offered as a managed Cloud. Sign-in, MFA, SSO, and RBAC work out of the box on standard OIDC. Billing follows tokens, and the day you want to move out, the door stays open.
No. Early demos, internal tools, one-off validation projects, or highly specific fine-grained authorization that off-the-shelf options can’t express can all be a fit for building your own, or half of it. What to avoid is taking on a long-term, generic piece of identity infrastructure without realizing it, and parking it inside a business team’s maintenance scope.
Authentication answers “who are you.” Authorization answers “what can you do.” In a real SaaS the two are hard to separate cleanly: users, organizations, roles, permissions, sessions, token claims, and audit logs all weave together. So when you replace an auth system, you can’t just look at the login page.
Because enterprise SSO means making your product plug into the customer’s own identity system. Different customers use different IdPs, protocols, claim fields, certificates, and organization mappings. Getting the first customer connected doesn’t make the rest copy-paste. More often it slowly turns into hand-work only one engineer understands.
Yes, though a single hard cutover usually isn’t the way. The realistic path is migrating in layers: put new sign-ups, new logins, and new enterprise SSO on the identity platform first, and migrate existing users gradually on their next login. Unify the user directory and organization model first, then work through fine-grained permissions over time, keeping a rollback path and audit logs throughout.
Because they introduce a new case: a client accessing resources on a user’s behalf. If the old system was designed only around a person logging in on a page, it struggles to answer who the token is issued to, what its scope is, how to revoke it, and who gets logged in the audit trail. At bottom this is the same class of business change as enterprise SSO, just with a newer trigger.