Circuit Times
Subscribe

SaaS Authentication: Options Compared With Real Tests

SaaS authentication options compared: methods, hosted prices, SSO costs, NIST and OWASP rules, and a real password hashing test.

  • 28 min read
  • 40 sections
  • Updated November 19, 2026
Amara Whitlock

Updated

How-to

SaaS authentication is how your product decides who someone is and whether to let them in. It covers sign-up, sign-in, passwords, multi-factor checks, sessions, account recovery and the single sign-on that business customers expect. It is also one of the hardest parts of a product to get right, because mistakes show up as breaches.

You have three broad choices. You can build it with libraries in your own code, use a framework or starter kit that includes it, or rent it from a hosted service. Each trades control against speed and cost. Most guides describe these choices in general terms. This one adds measurements.

I read the pricing pages of six authentication providers, collected a week of download counts for the main libraries and SDKs, checked the current NIST and OWASP guidance and ran a password hashing benchmark on a real machine. The figures from these sources are dated and sourced. The cost examples built from them, and the hours in my build-versus-buy model, are invented to show the math.

The short answer

For most new SaaS products, start with a proven library or a hosted service, not custom code. Use passkeys or a password with a strong hash, add multi-factor authentication, keep sessions short and revocable, and plan for single sign-on before your first large customer asks.

Choose hosted authentication when speed matters and you can accept a vendor bill. Choose a library when you want control and no per-user fees, and you have the skill to maintain it. Whatever you choose, test account recovery, because attackers target it more than the login form.

Good to know

Prices and download counts are snapshots from October 28, 2026. Providers change plans often, so check each page before you decide.

What SaaS authentication has to do

Authentication confirms that the person signing in really owns the account. Authorization comes next and sets what that account is allowed to do. They are different jobs, and mixing them up causes many bugs. This guide focuses on authentication, with notes on where it meets authorization.

A SaaS product needs more than a login form. This list shows the jobs that authentication covers.

Sign-up and verification

Create accounts, and confirm that the email address is real.

Sign-in

Check credentials, such as a password, a passkey or a link sent by email.

Multi-factor checks

Request one more piece of evidence after the password, for example a code from an authenticator app or a tap on a hardware key.

Sessions

Keep the user signed in safely, and end sessions when needed.

Recovery

Let users regain access without letting attackers do the same.

Organizations

Group users into teams or companies, with roles.

Enterprise sign-in

Connect to a customer's identity system with SAML or OpenID Connect.

Machine access

Issue API keys and tokens for programs, not people.

Audit

Record who did what, and when.

Our multi-tenant SaaS guide walks through keeping each organization's records apart from everyone else's. Authentication tells you who is calling, and tenant isolation controls what they can reach.

SaaS authentication methods compared

Each sign-in method has strengths and weaknesses. Most products offer more than one. This table is our summary.

MethodHow it worksStrengthWeakness
PasswordThe user knows a secretFamiliar, works everywhereReuse, phishing and weak choices
Magic linkA one-time link is emailedNo password to steal or forgetDepends on email security
Social loginSign in with another accountFast sign-up, fewer passwords to manageDependence on providers, account linking issues
PasskeyA cryptographic key stored on a deviceResists phishing, nothing to reuseRecovery and device changes need care
Authenticator codeA time-based code from an appStrong second factorPhishable in real time
SMS codeA code sent by text messageEasy for usersWeak against SIM swaps and interception
Security keyA hardware deviceStrong against phishingCost and loss
Enterprise single sign-onThe customer's identity system signs the user inCentral control for the customerSetup work for each customer

Our guide to MFA methods compares second factors in more detail, and our single sign-on guide explains how enterprise sign-in works.

What NIST says about passwords

The National Institute of Standards and Technology publishes digital identity guidelines that many organizations follow. I read the current text of its authentication guidance, Special Publication 800-63B, on October 28, 2026.

Where a password is the only factor, the guidance sets a floor of 15 characters. When a password is combined with a second factor, the floor drops to eight characters. On the upper end, a system should accept passwords of 64 characters or longer.

Two common habits are ruled out. A system must not add composition rules of its own, for example demanding upper case, digits and symbols together, and it must not make people replace their passwords on a schedule. The only trigger for a forced change is a sign that the password has leaked or been misused.

Why this matters in practice

Many products still require symbols and forced resets, which the guidance rejects. Longer passwords and checks against known-breached passwords do more good than complexity rules. Offer a password manager-friendly form, allow pasting and accept long passphrases.

Storing passwords safely

If you store passwords, you must store a hash made with a slow algorithm, never the password itself. The OWASP Password Storage Cheat Sheet is where most teams look up the settings, and I went through its text on October 28, 2026.

Argon2id comes first on its list, configured with no less than 19 MiB of memory, an iteration count of two and a parallelism of one. Where that is not possible, it points to scrypt with a cost parameter of 2 to the power of 17, a block size of 8 and parallelism of 1. Older systems can use bcrypt with a work factor of 10 or higher, remembering its 72-byte password limit. For systems bound by FIPS 140, its answer is PBKDF2 using HMAC-SHA-256, run for at least 600,000 iterations.

A real benchmark

I ran these settings on a Linux machine with an Intel Xeon processor and one logical core, using Python 3.12.3, argon2-cffi 25.1.0, bcrypt 5.0.0 and the standard library for scrypt, PBKDF2 and SHA-256. Each setting ran once to warm up and then 15 times, and the table shows the median. The slowest and fastest runs of every setting were within a few percent of the median, except for a few outliers in the Argon2id and scrypt runs. The last row is a plain SHA-256 hash, timed over 100,000 repeated calls so that timer overhead does not distort it, and it is shown only as a warning.

Algorithm and settingTime per hashHashes per second per core
Argon2id, 19 MiB, 2 iterations, 1 lane17.5 ms57
Argon2id, 64 MiB, 3 iterations, 1 lane109 ms9
scrypt, N=2^17, r=8, p=1, 128 MiB307 ms3
scrypt, N=2^15, r=8, p=3, 32 MiB193 ms5
bcrypt, cost 1057.2 ms17
bcrypt, cost 12229 ms4
PBKDF2-HMAC-SHA256, 600,000 iterations127 ms8
SHA-256, one passabout 0.33 microsecondsabout 3,075,000

A single SHA-256 pass lets one core test about 3.1 million guesses a second on this machine. The OWASP minimum Argon2id setting allows about 57, which is roughly 54,000 times slower. The other settings are between about 4,000 and 12,000 times slower than the Argon2id minimum. That gap is the point of slow hashing: it makes a stolen database much more expensive to attack.

Attackers use graphics cards and custom hardware, which are much faster than one core. The memory-hard algorithms, Argon2id and scrypt, are designed to resist that by requiring a lot of memory per guess. Treat my figures as a comparison between settings on one machine, not as attacker speeds.

What it costs you

Slow hashing costs you capacity, too. I measured one core, so the eight-core figures here are my multiplication, and they assume that hashing scales perfectly across cores and that the server does nothing else. Under those assumptions, a login that takes 17.5 milliseconds of one core means eight cores could handle about 458 logins a second, and a burst of 5,000 logins would take about 11 seconds. At 109 milliseconds, the same assumptions give about 74 logins a second. Real servers have other work, memory limits and scheduling costs, so treat these as upper bounds.

Memory matters as well. Eight hashes at 19 MiB use about 152 MiB at once. So a wave of sign-in attempts can exhaust your own machines and take the service down without any break-in. Rate-limit sign-in attempts, and run hashing where a burst cannot starve the rest of your application.

Choosing a setting

Pick the strongest setting your hardware can handle at your peak login rate without hurting the user's experience. Many teams aim for a hash time well under half a second. Test on your own production hardware, and revisit the choice every year or two, as hardware gets faster.

If you use a hosted service or a framework, check which algorithm it uses and whether it can upgrade hashes when users sign in. A good system rehashes old passwords with stronger settings at the next login.

Passkeys

With a passkey, the user's phone, laptop or password manager holds a key pair created for your site. Your server keeps only the public half, and at sign-in the device signs a challenge to show it holds the private half. Because nothing secret is sent or stored on the server, there is no password to phish or leak.

The server-side passkey library in my download data, SimpleWebAuthn, had about 5.98 million downloads in the week ending October 26, 2026. That shows the technique is in wide use among developers, though downloads do not tell you how many end users sign in this way.

Passkeys have rough edges. Users change devices, share accounts and lose phones. Plan for recovery, for a second passkey and for a fallback. Keep the other sign-in methods available at launch and retire them slowly, if at all.

Sessions and tokens

After sign-in, the product must remember the user. There are two common approaches: a server-side session identified by a random cookie, and a signed token, often a JSON Web Token, that the client sends with each request.

ApproachStrengthWeakness
Server-side sessionEasy to revoke, small cookie, data stays on the serverNeeds a shared store
Signed tokenVerifies without a lookup, works across servicesHard to revoke before expiry

Most web products are well served by server-side sessions in secure, HTTP-only cookies. Tokens suit APIs and distributed systems, with short lifetimes and refresh tokens. The library that verifies tokens, jose, had about 142 million downloads in the same week, which shows how common token handling is, including as a dependency of other tools.

Session rules to set

Lifetime

Set a maximum age for each session and a shorter limit for inactivity.

Rotation

Issue a new session identifier at sign-in and after privilege changes.

Revocation

Let users and administrators end sessions, and end them after password changes.

Cookie flags

Use secure, HTTP-only and same-site settings.

Sensitive actions

Ask for a fresh check before changes to email, password or billing.

Hosted services set some of these for you, sometimes by plan. Clerk's pricing page lists a fixed seven-day session lifetime on its free Hobby plan, for example. Check the limits that apply to the plan you use.

Build, use a library or rent it

There are three ways to get authentication into a product. The differences come down to three things: the author of the code, the operator of the service and the party that carries the bill as usage climbs.

ApproachWhat it meansControlEffort at the startCost as you grow
Custom codeYou write sign-in and sessions yourselfTotalHighYour time
Library or frameworkYou use open-source code inside your appHighMediumYour time and hosting
Hosted serviceA vendor runs sign-in, you call its APILowerLowPer user or per connection fees

Custom code is rarely wise. Authentication is a security-critical area with many subtle traps, such as timing attacks, session fixation and unsafe recovery flows. Use code that many people have reviewed.

A library keeps your data in your own database and avoids per-user fees, but you own the configuration, the updates and the incident response. A hosted service moves most of that work to a vendor, and you pay for it as you grow.

What developers use: download counts

Download counts show what developers install, which is a rough guide to adoption. They are imperfect: they include automated builds and dependencies of other packages, and they do not count end users. These are npm download counts for the week of October 20 through October 26, 2026, taken straight from the npm registry.

PackageWhat it isDownloads, one week
joseJSON Web Token and signing library142,086,376
better-authOpen-source authentication library11,293,540
firebaseGoogle's client SDK, including Authentication9,232,176
@supabase/ssrSupabase's server-side rendering helpers, including authentication9,147,440
passportLong-standing Node.js authentication middleware7,144,364
next-authAuthentication library for Next.js6,224,897
@simplewebauthn/serverPasskey server library5,975,527
@auth/coreThe core of Auth.js, the successor to next-auth4,353,078
@aws-sdk/client-cognito-identity-providerAmazon Cognito client3,717,387
@workos-inc/nodeWorkOS client3,266,668
@clerk/nextjsClerk's Next.js package2,505,600
keycloak-jsKeycloak browser client942,349
@auth0/nextjs-auth0Auth0's Next.js package873,440
luciaLucia authentication library381,903

Three cautions apply. First, a package can be a dependency of larger tools, so jose's count mostly reflects its use under other libraries. Second, firebase and @supabase/ssr serve many features besides sign-in. Third, a package used in automated builds counts every time it is installed.

Even so, the table shows that libraries you run yourself, such as better-auth, next-auth and passport, are heavily used, alongside the vendor SDKs. Pick by what your product requires, because a download total cannot make that call for you.

A note on Lucia

Lucia's weekly downloads are small next to the others, at about 382,000. I did not research its project status, so I do not recommend for or against it. If you consider any library with low or falling adoption, check its repository for recent activity and its documentation for any notice of maintenance changes.

What SaaS authentication providers charge

Hosted services bill by users, by connections or by features, and the definitions differ. I read each provider's pricing page on October 28, 2026.

ProviderFree allowanceWhat the page lists after that
ClerkHobby plan, free, 50,000 monthly retained users per appPro plan includes 50,000 retained users and lists $0.02 per additional user per month, with volume discounts
Auth0Free plan, up to 25,000 monthly active usersEssentials at $35 a month and Professional at $240 a month, shown for 500 monthly active users on the page's selector
WorkOS AuthKitFree up to 1 million monthly active users$2,500 a month for each additional million users
Supabase AuthFree plan, 50,000 monthly active usersPro plan at $25 a month includes 100,000 users, then $0.00325 per user
Google Identity PlatformFirst 50,000 monthly active users free$0.0055 per user from 50,000 to 100,000, then $0.0046 per user up to 1,000,000
Amazon Cognito EssentialsFirst 10,000 monthly active users free$0.015 per user above the free tier

What counts as a user

The definitions matter as much as the prices. Clerk bills on monthly retained users. By its own explanation, a signup counts only after the person comes back a day or more later, so a visitor who registers once and disappears costs nothing. Other providers count any user who is active in the month.

WorkOS says a user is active if they perform any user action within the calendar month, such as signing up, signing in or updating a profile. Google Identity Platform counts an account as active if it signed in during the month, and charges per message for phone and multi-factor authentication users.

Because of these differences, a count of 100,000 users can mean different bills on different services. Compare them using your own data on how many users sign in each month. Auth0 is not in the cost table below. Its pricing page shows plans tied to the user count chosen on a selector, and I did not model those steps. That leaves five providers in the table, which should be read as a worked illustration, since the plans are not directly equivalent.

What it costs at different sizes

I calculated monthly costs at several user counts, using the published rates above. The table leaves out plan base fees except for Supabase, whose Pro plan is $25 a month. The Clerk column shows only the overage beyond 50,000 retained users, at the list rate and before volume discounts, and it counts retained users, which are fewer than active users.

Monthly usersSupabase ProCognito EssentialsGoogle Identity PlatformClerk overage onlyWorkOS AuthKit
1,000$25$0$0$0$0
10,000$25$0$0$0$0
50,000$25$600$0$0$0
100,000$25$1,350$275$1,000$0
250,000$512.50$3,600$965$4,000$0
1,000,000$2,950$14,850$4,415$19,000$0

The spread is large. At a million users, the same volume costs anywhere from nothing to $19,000 a month at list prices, depending on the provider and the definition of a user. At 100,000 users, the range is $0 to $1,350.

Do not read the columns as a league table. Each service bundles different features, caps and support levels. They show why you should model your own growth before committing, and why a price per user can matter more than a feature list once you scale.

Cheap now, costly later

Free tiers are generous at small sizes. A product with 5,000 users pays nothing on most services, which makes the early choice feel free. The bill arrives later, once the user count has climbed, and at that stage a switch of provider takes real effort. Treat the pricing at ten times your current size as part of the decision.

Enterprise single sign-on

Large customers want to sign in with their own identity system, using SAML or OpenID Connect. Each customer needs a connection. This is where hosted prices change shape, because charges are per connection, not per user.

WorkOS prices each connection at $125 a month up to the 15th. The rate falls to $100 for the 16th through 30th, $80 for the 31st through 50th and $65 for the 51st through 100th. Clerk's pricing page lists one SSO connection included on Pro and $75 a month for each additional connection. Auth0's free plan lists one enterprise connection. Google Identity Platform charges $0.015 per active user for SAML and OpenID Connect users after the first 50, and Cognito charges $0.015 per user after its first 50.

I calculated monthly connection costs for three customer counts. Clerk's figure uses the list rate and ignores volume discounts.

Customers needing single sign-onWorkOSClerk Pro, extra connections
5$625$300
20$2,375$1,425
40$4,175$2,925

Passing the cost on

Many products charge extra for single sign-on, because it costs money and large customers value it. If a connection costs you $125 a month, a surcharge or a higher plan that includes it keeps your margin intact. Our SaaS pricing strategy guide explains how to put single sign-on in a higher tier.

Build it yourself?

You can implement SAML yourself, but it is intricate, and each customer's identity provider behaves a little differently. I modeled the cost with invented numbers: 120 hours to build the first version and 6 hours per customer connection, at $75 an hour.

CustomersBuild costWorkOS fee per monthMonths of fees the build equals
5$11,250$62518.0
20$18,000$2,3757.6
40$27,000$4,1756.5

The break-even in months is the build cost divided by the monthly vendor fee. A customer is not always one billable connection, since a customer with several identity systems may need several. The model ignores upkeep, security fixes and support, which add real cost to the build option. It suggests that with few customers, buying is cheaper, and with many, building looks cheaper on paper. Count your own team's hours and the risk of getting it wrong before you decide.

Our single sign-on guide explains what to check in an implementation, and our privileged access management guide covers the controls around administrator accounts.

B2B SaaS authentication needs

Business customers expect features that consumer sign-in does not cover. This table lists the usual ones.

NeedWhat it meansWhy customers ask
OrganizationsUsers belong to a company workspaceBilling and data belong to the company
Roles and permissionsAdmins, members and custom rolesLeast privilege
Single sign-onSign in with the company's identity providerCentral control and compliance
Directory syncUsers added and removed automatically from the customer's directoryOffboarding without manual work
Domain verificationA company proves it owns its email domainPrevents impersonation
Audit logsA record of sign-ins and changesInvestigations and audits
Session controlsLimits on session length and devicesSecurity policy

Clerk's pricing page lists directory sync connections at $75 a month each from January 1, 2027, on top of what the plans include. Check which of these features are in your plan, and when charges begin.

Hosted services bundle many of these features, while libraries often leave them to you. Starter kits vary. Our SaaS starter kits comparison shows which open-source kits include teams and single sign-on.

Protecting accounts

Account takeover is the main risk. Attackers use stolen passwords from other sites, phishing and weak recovery. These controls reduce it.

Multi-factor authentication

Offer authenticator apps, passkeys and security keys, and avoid relying on SMS alone.

Breached password checks

Compare each new password against lists from past breaches, and refuse any that turns up. Our guide on how to check if an email was in a data breach explains where such data comes from.

Rate limiting

Limit sign-in and reset attempts per account and per address.

Bot protection

Add challenges when behavior looks automated.

Notifications

Tell users about new sign-ins and security changes.

Session management

Show active sessions, and let users end them.

Attackers often skip the login and go straight to recovery. If a reset email, a support agent or a security question can bypass your multi-factor check, the check is worth little. Apply the same strength to recovery as to sign-in. Our social engineering guide explains how attackers manipulate support staff, and our phishing guide covers the messages that start many takeovers.

Email security matters too, because email is often the key to recovery. Remind people to lock down their mailbox too, ideally with a passkey or an authenticator app.

Protocols you will meet

Authentication products use a small set of standards. Once you can say what job each standard does, vendor docs and customer security questionnaires get much easier to follow.

StandardWhat it is forWhere you meet it
OAuth 2.0Letting an app act on a user's behalf with limited accessSocial login, API access, connecting other services
OpenID ConnectA sign-in layer built on OAuth 2.0 that tells the app who the user isSocial login, modern enterprise single sign-on
SAML 2.0An older, XML-based standard for single sign-on between organizationsEnterprise customers with established identity systems
WebAuthnThe browser standard behind passkeys and security keysPasskeys, hardware keys
SCIMA standard for provisioning and removing users automaticallyDirectory sync with customer systems
JSON Web TokenA signed data format for carrying claimsSession tokens, API tokens

OAuth and OpenID Connect are often confused. OAuth is about permission to do things, and OpenID Connect adds a way to learn who signed in. Sign-in with another account uses OpenID Connect on top of OAuth.

SAML is older, but many large companies still require it, so a product that sells to them needs to support it. Providers differ in how much of this they handle for you, which is why the single sign-on cost comparison above matters.

Many sign-in flows depend on email: verification, magic links and password resets. If those messages land in spam or arrive late, users cannot sign in, and support tickets rise.

Treat authentication email as critical. Send it from a verified domain with proper authentication records, keep the wording short and make links expire quickly. Leave account data and other private details out of the email body. Our SaaS marketing guide covers the sender rules that large mailbox providers apply, which also affect transactional mail.

Magic links have risks as well. A link works for whoever opens it, so tie it to the browser that requested it where you can, make it single-use and expire it within minutes. Watch for link scanners in corporate email systems, which can open a link before the user does and use it up.

Machine access: API keys and tokens

Not every caller is a person. Programs call your API with keys or tokens, and they need their own authentication. This part is often an afterthought, and attackers know it.

PracticeWhy it matters
Hash keys at restA database leak should not reveal working keys
Show a key onceUsers must store it safely, and you cannot recover it
Scope keysA key should do only what its owner needs
Allow rotationUsers must be able to replace a key without downtime
Expire or review old keysUnused keys are a risk
Log useYou can spot abuse and answer questions

Give keys a recognizable prefix so that secret scanners can find them if they leak into public code. Rate-limit by key, and let customers revoke any key instantly.

Testing your authentication

Authentication fails in the details, so test it as an attacker would. This table lists tests that find common problems. Run them on a test system you own.

TestWhat you checkWhat a failure looks like
Credential stuffingMany sign-in attempts with leaked pairsNo rate limit or lockout
Account enumerationDifferent messages for known and unknown emailsThe form reveals which emails exist
Reset token reuseUsing a reset link twiceThe link works a second time
Reset token expiryUsing an old linkAn old link still works
Session fixationSetting a session before sign-inThe same identifier survives sign-in
Session after password changeUsing an old sessionOld sessions remain valid
Cross-tenant accessChanging an identifier to another team'sYou can read another tenant's data
Missing authorizationCalling an endpoint without a tokenThe server answers anyway
Weak second factorSkipping the second stepCalling the endpoint directly gets past it

Run the whole list ahead of launch, and repeat it whenever sign-in code changes in a big way. Our multi-tenant SaaS guide shows how I tested cross-tenant access on a real database, including a case where a forgotten filter returned another customer's record.

Automate what you can, and keep a manual review for recovery flows, which are hard to cover with scripts.

How to choose

The right choice depends on your stage, team and customers. This table is our analysis.

SituationLikely good fitWhy
Early product, small team, speed mattersHosted service or a framework with authentication built inFastest path, low cost at small scale
Developer team that wants controlOpen-source libraryData stays with you, no per-user fees
Already on a cloud platformThat platform's authentication serviceFits your stack and billing
Selling to large companies soonA service or library with strong SSO supportSingle sign-on is a deal requirement
Very large consumer scaleCheck costs carefully, and consider a library or negotiated pricingPer-user fees add up

A weighted scorecard

Compare finalists with a weighted scorecard of my own design. Assign every criterion a weight of 1 to 3, then rate each option between 0 and 2.

CriterionWeightWhat a 2 looks like
Security track record3Active maintenance, clear disclosures, independent reviews
Cost at ten times your size3Predictable bill at your target scale
Single sign-on and organizations2Built in, with clear pricing
Developer experience2Good docs and a clean integration with your framework
Control of user data2You can export users and hashes
Exit path3You could leave without forcing a password reset for everyone

Planning your exit

Authentication is hard to change later, because users expect to keep their accounts. Ask whether you can export users, password hashes and multi-factor settings. If a service does not let you export hashes, switching means every user must reset a password, which costs you users.

Keep your own user identifier in your database, and map the provider's identifier to it. That way, a change of provider does not change your core data.

Migrating between providers

Sooner or later, many products change their authentication setup. Costs rise, a vendor changes terms or a larger customer needs a feature. The way you migrate decides how many users you lose.

The key question is whether you can move password hashes. If the old system lets you export them and the new one can verify them, users sign in as before, and you can upgrade hashes at their next login. If not, every user must reset a password, which is a point where some give up.

I modeled the cost with invented numbers. A product has 10,000 paying users at $15 a month, so $150,000 of monthly recurring revenue. Suppose a forced reset causes 4 percent of paying users to lapse, and a hash-preserving migration causes 0.5 percent.

Migration methodPaying users lostMonthly revenue lostYearly revenue lost
Forced password reset400$6,000$72,000
Hash export and gradual rehash50$750$9,000

The difference is $5,250 a month, or $63,000 a year, in this model. The percentages are guesses, and your numbers will differ, but the shape holds: a migration that keeps users signed in is worth real money.

How to migrate safely

Export first

Confirm that you can export users, hashes, multi-factor settings and linked social accounts before you sign a contract.

Run both systems

Verify against the old system at sign-in, and write the new hash when it succeeds.

Move in stages

Migrate a small group, watch support tickets and expand.

Keep your own user identifier

Map provider identifiers to your own, so the change does not touch the rest of your data.

Tell users early

A short notice reduces confusion, especially if second factors must be set up again.

Plan a rollback

Keep the old system available until the new one is stable.

Authentication and compliance

Customers and auditors may ask how you handle sign-in. Be ready with clear answers about password storage, multi-factor options, session limits, logging and single sign-on. NIST's guidance is a common reference, and customers often ask whether you follow it.

Keep records of your decisions, including which standard you followed and why. Review them yearly, because guidance and threats change. Our privileged access management guide covers how to control and record administrator access, which auditors often examine alongside user sign-in.

Implementation checklist

  • Use a maintained library or service, not custom code.
  • Store passwords only as Argon2id, scrypt, bcrypt or PBKDF2 hashes, configured to the published minimums or stronger.
  • Allow long passwords and passphrases, and avoid composition rules and forced resets.
  • Offer multi-factor authentication, and prefer passkeys and authenticator apps over SMS.
  • Use secure, HTTP-only, same-site cookies, with rotation and revocation.
  • Rate-limit sign-in, signup and reset.
  • Protect recovery as strongly as sign-in.
  • Plan single sign-on and organization features before enterprise sales.
  • Log sign-ins and security events.
  • Test the flows as an attacker would.

A 60-day plan

This plan is our suggestion for a team adding or replacing authentication.

Days 1 to 10

Write requirements. List the methods, organization needs, compliance needs and expected user counts.

Days 11 to 20

Shortlist and model costs. Compare three options, and calculate cost at ten times your size.

Days 21 to 35

Prototype. Build sign-up, sign-in, recovery and a second factor with the top choice.

Days 36 to 45

Attack your prototype. Try credential stuffing, reset abuse and session theft on a test system.

Days 46 to 55

Add organizations and logging. Prepare for single sign-on.

Days 56 to 60

Launch and monitor. Watch failed sign-ins, resets and support tickets.

Common mistakes

Writing your own crypto or sessions

Use reviewed code.

Using a fast hash for passwords

One SHA-256 pass is about 54,000 times faster to guess than the OWASP minimum Argon2id setting on my machine, in a simple one-core comparison.

Forcing complexity and resets

Current NIST guidance rejects both.

Relying on SMS

It is the weakest common second factor.

Ignoring recovery

Attackers target it.

Forgetting single sign-on

Large customers will ask, and it takes time.

Pricing at today's size

Costs can change by orders of magnitude.

No exit plan

Without exported hashes, you are locked in.

Skipping rate limits

A login flood can also overload your servers.

Reproduce the numbers

This script reproduces the hashing benchmark and the cost calculations in this guide. Install the argon2-cffi and bcrypt packages first. The benchmark prints its own environment details, and timings depend on your hardware, so expect different numbers, with the same pattern. The package download counts, provider prices and standards quotes are not produced by the script. They come from the sources named in the guide.

import hashlib
import os
import platform
import statistics
import sys
import time
from importlib.metadata import version

import bcrypt
from argon2.low_level import Type, hash_secret_raw

print("Python", sys.version.split()[0], "|", platform.platform())
print("argon2-cffi", version("argon2-cffi"), "| bcrypt", version("bcrypt"), "| logical CPUs available:", os.cpu_count())
try:
    with open("/proc/cpuinfo") as handle:
        model = next(line.split(":", 1)[1].strip() for line in handle if line.startswith("model name"))
    print("CPU model:", model)
except (OSError, StopIteration):
    print("CPU model: not available")

password = b"correct horse battery staple"
salt = os.urandom(16)
RUNS = 15

settings = {
    "Argon2id 19 MiB, t=2, p=1": lambda: hash_secret_raw(password, salt, time_cost=2, memory_cost=19456, parallelism=1, hash_len=32, type=Type.ID),
    "Argon2id 64 MiB, t=3, p=1": lambda: hash_secret_raw(password, salt, time_cost=3, memory_cost=65536, parallelism=1, hash_len=32, type=Type.ID),
    "scrypt N=2^17, r=8, p=1": lambda: hashlib.scrypt(password, salt=salt, n=2 ** 17, r=8, p=1, maxmem=256 * 1024 * 1024, dklen=32),
    "scrypt N=2^15, r=8, p=3": lambda: hashlib.scrypt(password, salt=salt, n=2 ** 15, r=8, p=3, maxmem=256 * 1024 * 1024, dklen=32),
    "bcrypt cost 10": lambda: bcrypt.hashpw(password, bcrypt.gensalt(10)),
    "bcrypt cost 12": lambda: bcrypt.hashpw(password, bcrypt.gensalt(12)),
    "PBKDF2-SHA256 600,000": lambda: hashlib.pbkdf2_hmac("sha256", password, salt, 600000, 32),
}

def measure(function, runs=RUNS, repeat=1):
    function()
    samples = []
    for _ in range(runs):
        start = time.perf_counter()
        for _ in range(repeat):
            function()
        samples.append((time.perf_counter() - start) / repeat)
    return samples

results = {}
for name, function in settings.items():
    samples = measure(function)
    results[name] = statistics.median(samples)
    print(f"{name}: median {results[name] * 1000:,.1f} ms, min {min(samples) * 1000:,.1f}, max {max(samples) * 1000:,.1f}, about {1 / results[name]:,.1f} per second per core")

sha_samples = measure(lambda: hashlib.sha256(salt + password).digest(), runs=RUNS, repeat=100000)
sha = statistics.median(sha_samples)
print(f"One SHA-256 pass: median {sha * 1e6:,.2f} microseconds, about {1 / sha:,.0f} per second per core")
base = results["Argon2id 19 MiB, t=2, p=1"]
print(f"Minimum Argon2id setting is {base / sha:,.0f} times slower than one SHA-256 pass on this machine")
print(f"Ideal 8-core capacity at the minimum Argon2id setting: {8 / base:,.0f} logins a second; 5,000 logins in {5000 / (8 / base):.1f} seconds; memory for 8 at once: {8 * 19} MiB")

print("\nHosted authentication cost by monthly users (list prices read October 28, 2026)")
def supabase(m): return 25 + max(0, m - 100000) * 0.00325
def cognito_essentials(m): return max(0, m - 10000) * 0.015
def google_identity(m): return max(0, min(m, 100000) - 50000) * 0.0055 + max(0, min(m, 1000000) - 100000) * 0.0046
def clerk_overage(m): return max(0, m - 50000) * 0.02
def workos(m): return 0 if m <= 1000000 else 2500 * ((m - 1) // 1000000)
for m in (1000, 10000, 50000, 100000, 250000, 1000000):
    print(f"   {m:>9,} users: Supabase Pro ${supabase(m):>9,.2f} | Cognito Essentials ${cognito_essentials(m):>9,.2f} | Google Identity Platform ${google_identity(m):>9,.2f} | Clerk overage only ${clerk_overage(m):>9,.2f} | WorkOS AuthKit ${workos(m):>6,.0f}")

print("\nEnterprise single sign-on connections per month")
def workos_sso(n):
    total, left = 0, n
    for size, price in ((15, 125), (15, 100), (20, 80), (50, 65)):
        take = min(left, size); total += take * price; left -= take
    return total
def clerk_sso(n): return max(0, n - 1) * 75
for n in (5, 20, 40):
    print(f"   {n} connections: WorkOS ${workos_sso(n):,}, Clerk Pro extra connections ${clerk_sso(n):,}")

print("\nBuild single sign-on yourself (invented hours): 120 hours to build, 6 hours per customer connection, $75 an hour")
for n in (5, 20, 40):
    build = (120 + 6 * n) * 75
    print(f"   {n} connections: build cost ${build:,}; WorkOS ${workos_sso(n):,} a month; build pays back after {build / workos_sso(n):.1f} months of WorkOS fees (ignores upkeep and support)")

paying_users, arpu = 10000, 15
for label, share in (("forced reset", 0.04), ("hash export", 0.005)):
    lost = paying_users * share
    print(label, round(lost), round(lost * arpu), round(lost * arpu * 12))

Frequently asked questions

What is SaaS authentication?

The way a software product verifies who a user is. It covers sign-up, sign-in, multi-factor checks, sessions, recovery and, for businesses, single sign-on.

What are the main SaaS authentication options?

Build it with your own code, use an open-source library or framework, or use a hosted service. Libraries and hosted services are the common choices.

What is the best authentication for SaaS?

It depends on your team, scale and customers. Hosted services suit speed, libraries suit control, and large customers push toward strong single sign-on. I did not test every provider, so compare costs and security for your case.

What are SaaS authentication best practices?

Use a maintained library or service, hash passwords with a slow algorithm, allow long passwords, offer multi-factor authentication, keep sessions revocable, rate-limit attempts and protect recovery.

How should a SaaS app store passwords?

Hash them with Argon2id, scrypt, bcrypt or PBKDF2 at recommended settings. OWASP's minimum for Argon2id is 19 MiB of memory, two iterations and one lane.

What does NIST say about password length?

For passwords used alone, at least 15 characters. For passwords used only with another factor, at least eight. The upper limit should be no lower than 64 characters, and neither character-mix rules nor scheduled changes should be imposed.

What is the difference between authentication and authorization?

Authentication checks identity, so the product knows which account is signing in. Authorization follows and controls what that account can reach. A product needs both.

Are passkeys better than passwords?

For phishing, yes: a passkey works only on the real site, and the server holds nothing secret that a breach could expose. They need recovery and fallback plans, so most products offer them alongside other methods.

Auth0 vs Clerk: which is cheaper, and what is clerk vs auth0 pricing?

It depends on your count of users, the definition each service uses and the plan. Clerk counts retained users and Auth0 counts active users, so compare using your own data and check both pricing pages.

How much does hosted authentication cost at 100,000 users?

At list prices on October 28, 2026, my calculations ranged from $0 to $1,350 a month across five providers, before plan fees and features. Check current pricing.

How do I add single sign-on to a SaaS product?

Use a service that supports SAML and OpenID Connect, or build it yourself. Cost per connection in my examples ranged from $65 to $125 a month, and the build option needed about 120 hours plus 6 hours per customer in my model.

Should I use JWTs or sessions?

Server-side sessions in secure cookies are simple and easy to revoke. Tokens suit APIs and distributed systems, with short lifetimes and refresh tokens.

A quick checklist

Up nextmulti-tenant SaaS guideKnowing who a user is only helps if each customer's data stays separate. Our multi-tenant SaaS guide covers that separation, and the single sign-on guide covers enterprise sign-in.

From circuittimes.com/business/saas-authentication/

Was this guide helpful?

Keep going

More in SaaS

See all

The briefing, without the noise.

The stories that matter in technology, every weekday morning.

Free. Unsubscribe in one click.