LM-01
Authentication
LM-01Authentication
Every sign-in method, taken apart.
Passkeys, email codes, magic links, social accounts, enterprise single sign-on and a second factor ship in the same component. This chapter shows what each one puts on the wire, where it is strong and where it is not.
- Title
- Authentication
- Doc. no.
- LM-01
- Rev.
- 04
- Issued
- Nov 2026
- Sheet
- 1 of 4
1.0Passkeys
Passkeys: a key pair instead of a secret.
A passkey is a private key that never leaves the user's device and a public key that Latch stores. Signing in means signing a random challenge. There is no shared secret to phish, leak or reset.
Ceremony
- Algorithms
- ES256, EdDSA
- User verification
- Required
- Synced passkeys
- Accepted
- Passkeys per user
- 20
- Fallback
- Email code
The component asks Latch to start a registration for the signed-in user. Nothing about the device is sent yet.
Step
On the wire at step 1
{ "user_id": "usr_2f8c41d07a", "authenticator": "platform"}2.0Email
Email codes and magic links, with the inbox in view.
The most familiar way in, and the fallback for every other method. Type an address on the left and watch the message arrive on the right: the same template, timing and limits your users get.
Sign in to Acme
- Nothing from Acme yet. Send a code.
- Code length
- 6 digits
- Lifetime
- 10 minutes
- Attempts per code
- 5
- Resend after
- 30 seconds
- Magic link
- Single use
- Median delivery
- 2.4 s
Send as
Your sender Messages leave from your domain with your DKIM key. Latch's name appears nowhere in the inbox.
The code Six digits, grouped in threes so they survive being read aloud. The subject line carries them too, so a lock-screen preview is enough.
Browser binding A magic link opened in another browser does not sign that browser in. It confirms the request, and the tab that asked gets the session.
Five attempts The fifth wrong code burns it. A new one can be requested after 30 seconds, and requests are limited per address and per IP.
3.0Social and SSO
Social sign-in for people. SAML and OIDC for their employers.
Social providers are a switch. Enterprise connections are a link you send to your customer's IT admin, who pastes two values and is done. Underneath, both are the handshake below.
Marta types marta@okapi.health into your sign-in box. There is no “SSO” button to find: the domain decides.
Step
Message 1 · Browser → Your app
Enter work email
Marta types marta@okapi.health into your sign-in box. There is no “SSO” button to find: the domain decides.
Nothing to show on the wire: this step is a person at a keyboard.
Parties in this figure
- Browser
- Marta's laptop
- Your app
- app.acme.dev
- Latch
- auth.acme.dev
- IdP
- Okta
3.2Social providers
Three on Free, all of them from Pro. Each uses your own OAuth credentials in production, so the consent screen says your name.
| Provider | Protocol | Default scopes | Email verified by provider |
|---|---|---|---|
| OIDC | openid email profile | Yes | |
| GitHub | OAuth 2.0 | read:user user:email | Yes, primary address |
| Apple | OIDC | name email | Yes, may be a relay address |
| Microsoft | OIDC | openid email profile | Work accounts only |
| GitLab | OIDC | openid email | Yes |
| Slack | OIDC | openid email profile | Yes |
Google
- Protocol
- OIDC
- Default scopes
- openid email profile
- Email verified by provider
- Yes
GitHub
- Protocol
- OAuth 2.0
- Default scopes
- read:user user:email
- Email verified by provider
- Yes, primary address
Apple
- Protocol
- OIDC
- Default scopes
- name email
- Email verified by provider
- Yes, may be a relay address
Microsoft
- Protocol
- OIDC
- Default scopes
- openid email profile
- Email verified by provider
- Work accounts only
GitLab
- Protocol
- OIDC
- Default scopes
- openid email
- Email verified by provider
- Yes
Slack
- Protocol
- OIDC
- Default scopes
- openid email profile
- Email verified by provider
- Yes
4.0MFA and step-up
A second factor when it matters, not on every click.
Requiring two factors at sign-in is one switch. Step-up is the finer tool: the session stays as it is until the user reaches something sensitive, and only then proves again who they are.
"use server";import { requireStepUp } from "@latch/nextjs";export async function changePayout(to: Iban) { await requireStepUp({ level: "aal2", maxAge: "10m", }); // Runs only with a fresh second factor. await payouts.setAccount(to);}Billing
Signed in as ada@acme.dev
One factor · email code
No recent second factor
- AAL1
Download invoices
billing:read - AAL1
Add a seat
billing:seats - Needs AAL2
Change payout account
billing:payout - Needs AAL2
Rotate API keys
apikeys:rotate
Nothing is asking for a second factor.
Run one of the two actions marked “Needs AAL2” to trigger the prompt.
Authenticator
Acme · ada@acme.dev
318 204
Request log
- No requests yet.
4.2Factors
| Factor | How it is checked | Counts as | Recovery |
|---|---|---|---|
| Passkey | Signature with user verification | Two factors in one | Another passkey |
| Authenticator app | TOTP, 30-second window, ±1 step | Second factor | Backup codes |
| Backup codes | Ten codes, single use, hashed | Second factor | Regenerate in profile |
| SMS code | Off by default; SIM swaps exist | Second factor | Admin reset |
Passkey
- How it is checked
- Signature with user verification
- Counts as
- Two factors in one
- Recovery
- Another passkey
Authenticator app
- How it is checked
- TOTP, 30-second window, ±1 step
- Counts as
- Second factor
- Recovery
- Backup codes
Backup codes
- How it is checked
- Ten codes, single use, hashed
- Counts as
- Second factor
- Recovery
- Regenerate in profile
SMS code
- How it is checked
- Off by default; SIM swaps exist
- Counts as
- Second factor
- Recovery
- Admin reset
5.0Bots and breaches
Most sign-in attempts are not people.
In October 2026, 13% of the requests that reached a Latch sign-in endpoint came from automation. These are the rated values of the layers that deal with them, on every plan, with nothing to configure.
Latch · Abuse protection
All production tenants, 1–31 Oct 2026
- Credential-stuffing attempts refused
61.461.4 MBefore a password was ever compared- Leaked password hashes checked against
1.31.3 BRefreshed weekly from public breach corpora- Humans who saw a challenge
0.40.4 %The other 99.6% never knew it ran- Added to a sign-in, p50
99 msScoring runs in the same edge location
5.1Layers, outermost first
| Layer | What it looks at | Response |
|---|---|---|
| Request scoring | TLS fingerprint, header order, pointer and timing signals | Invisible proof-of-work, then a challenge |
| Velocity limits | Attempts per account, per IP and per /24 in sliding windows | 429 with Retry-After |
| Breached passwords | SHA-1 prefix of the password against 1.3 billion leaked hashes | Sign-up refused, or reset forced at sign-in |
| Disposable email | 42,000 throwaway domains, updated daily | Sign-up refused with a plain message |
| Account lockout | Ten failures on one account | Locked for 15 minutes, owner notified |
Request scoring
- What it looks at
- TLS fingerprint, header order, pointer and timing signals
- Response
- Invisible proof-of-work, then a challenge
Velocity limits
- What it looks at
- Attempts per account, per IP and per /24 in sliding windows
- Response
- 429 with Retry-After
Breached passwords
- What it looks at
- SHA-1 prefix of the password against 1.3 billion leaked hashes
- Response
- Sign-up refused, or reset forced at sign-in
Disposable email
- What it looks at
- 42,000 throwaway domains, updated daily
- Response
- Sign-up refused with a plain message
Account lockout
- What it looks at
- Ten failures on one account
- Response
- Locked for 15 minutes, owner notified
5.2Breached passwords, checked without sending them
If you offer passwords, every new one is compared with the corpus before it is accepted, and every existing one at sign-in. The lookup is built so that neither Latch's corpus service nor anyone on the path learns the password, or even its full hash.
Hash SHA-1 of the password, computed in memory.
Prefix The first five characters go to the corpus. About 800 leaked hashes share any prefix.
Range Every suffix under that prefix comes back, with how often each was seen.
Verdict The match is made locally. The corpus never learns which suffix was yours.
Nothing you type here is sent anywhere. The hash is computed in this tab.
SHA-1, in memory
5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8Sent to the corpus
GET /v1/breach/range/5BAA6Returned: 792 suffixes
- BD17AA98BEF8D76DB89A0B6E4253DA5E9EF780
- 1E4C9B93F3F0682250B6CF8331B7EE68FD89,545,824
- E729A416F2460D264ED343CA652B55ADFA05,172
- DF21D80DBC5E061C8B67DF9F4BCC5FA95378,766
- … 788 more
Compared on the device
Seen 9,545,824 times in breaches. Refused at sign-up; a reset is forced at sign-in.
Comparison
6.0Comparison
Method by method.
Measured on production sign-ins in October 2026. Offer more than one: the table tells you which to put first.
| Method | The user needs | Recovery | Plan | |||
|---|---|---|---|---|---|---|
| PasskeyWebAuthn | FullOrigin-bound | A device with a screen lock | 4 s | 0.9% | Second passkey or email code | All |
| Social sign-inOIDC, OAuth 2.0 | PartialAs good as the provider | An account with the provider | 6 s | 1.8% | The provider's | All (3 on Free) |
| Enterprise SSOSAML 2.0, OIDC | PartialThe employer's policy | A company identity | 8 s | 1.2% | The customer's IT admin | Pro, $50 a connection |
| Passwordargon2id + breach check | NoneCan be typed anywhere | Memory | 9 s | 7.4% | Email reset | All |
| Magic linkSigned URL, single use | PartialBound to the asking browser | The inbox, on any device | 19 s | 4.6% | Ask again | All |
| Email code6 digits, 10 minutes | WeakCan be relayed live | The inbox, on any device | 23 s | 3.1% | Ask again | All |
| Authenticator appTOTP, second factor | WeakCan be relayed live | A phone with the app | 11 s | 2.2% | Backup codes | Pro |
Passkey
WebAuthn
FullOrigin-bound- Time to sign in
- 4 s
- Failure rate
- 0.9%
- Recovery
- Second passkey or email code
- Plan
- All
Social sign-in
OIDC, OAuth 2.0
PartialAs good as the provider- Time to sign in
- 6 s
- Failure rate
- 1.8%
- Recovery
- The provider's
- Plan
- All (3 on Free)
Enterprise SSO
SAML 2.0, OIDC
PartialThe employer's policy- Time to sign in
- 8 s
- Failure rate
- 1.2%
- Recovery
- The customer's IT admin
- Plan
- Pro, $50 a connection
Password
argon2id + breach check
NoneCan be typed anywhere- Time to sign in
- 9 s
- Failure rate
- 7.4%
- Recovery
- Email reset
- Plan
- All
Magic link
Signed URL, single use
PartialBound to the asking browser- Time to sign in
- 19 s
- Failure rate
- 4.6%
- Recovery
- Ask again
- Plan
- All
Email code
6 digits, 10 minutes
WeakCan be relayed live- Time to sign in
- 23 s
- Failure rate
- 3.1%
- Recovery
- Ask again
- Plan
- All
Authenticator app
TOTP, second factor
WeakCan be relayed live- Time to sign in
- 11 s
- Failure rate
- 2.2%
- Recovery
- Backup codes
- Plan
- Pro
Time is the median from focusing the first field to a session. Failure is the share of attempts abandoned or refused.
Questions
7.0Questions
8.0
Get started
8.0Get started
Switch on a method. The rest is already wired.
Every method on this page is a line in one array. Start with passkeys and email codes on the free plan, and add the others the day a customer asks.
npm install @latch/nextjsIncluded on Free
- Monthly active users
- 10,000
- Passkeys, codes, links
- Included
- Social providers
- 3
- Organizations
- 5 members each
- Card required
- No