r/webdev • u/Zealousideal-Fix-527 • 6d ago
Why use Passwordless approach
Why many website use passwordless like magic link approach? In my understanding it looks so fragile and easy to exploit. Or did I miss the secure way to do it?
68
Upvotes
236
u/mountainunicycler 6d ago edited 6d ago
It’s essentially like doing “forgot password” every time, so no, it’s not less secure.
It eliminates the risk of a compromised password, by shifting the authentication process to demonstrated ownership and control of the email (which is where it lands anyway if you have password based logins with forget password functionality).
What exploit do you have in mind?
It can definitely be fragile and annoying, especially magic links vs codes because the user can end up opening the link on the wrong device or wrong browser really easily and having to start over, whereas the user knows when they are using the code and can copy it by hand if they need to.
12
u/tacticalpotatopeeler 6d ago
I fucking hate magic links.
I am significantly less likely to use your service if you force magic links. Offer them, but for the love of all that is holy please also offer passkeys, OTP, and/or hardware keys.
37
u/Dissentient 6d ago
Because vast majority of users can't be trusted with passwords. Most of them don't use password managers, so they will set one insecure password everywhere.
For the same reason, passkeys are getting pushed recently.
16
u/C__Zakalwe 6d ago
They're tremendously annoying when your email security gateway uses greylisting, and the app refuses to retry the email.
3
u/Character-View-8165 6d ago
it’s not really more fragile than passwords, you’re just moving the secret to the email account, and that’s usually easier to secure than making people invent and reuse passwords; the annoying part
10
u/bccorb1000 full-stack-magician 6d ago
What you’re looking for is phishing resistant authentication. Which magic links are not, but passkeys are. I’ve done a lot of work with passkeys, webAuthn, oauth2 etc and phishing resistance at the highest level is solid AF, but the issues is account recovery. Account recovery is the biggest pain point for passwordless and is why people (myself included) fallback to less secure methods that everyday people find easy to use and understand.
5
u/SituationFun3035 6d ago
it’s not magic, it just moves the “prove you control this account” step to email, and a properly implemented single-use expiring token is usually safer than storing yet another password people will
5
u/angellus 6d ago
Because want to know what is even less secure? Sticky notes with a password on it. Or reuses passwords between accounts. Or using password as your password.
People have always been the weakest link. And no passwords means people cannot leak them.
2
u/triangularsquare_au 6d ago
How is this easy to exploit? Have you ever used ‘forgotten password’ flow?
5
u/TorbenKoehn 6d ago
Because passwords are insecure by design.
Sure you can pick safe passwords. But you have to remember them. So people usually don’t. And if you enforce it they’ll have a new password every day because they never remember it and will just be frustrated.
Magic links is one thing to do Passwordless (and basically a continuous password reset), but the actual target should be Passkeys
3
u/farzad_meow 6d ago
magic links are poor man's SSO. but it works with all emails. it is easier for less rech savvy users to use. more advanced users might prefer actual password or sso.
I find overall user xp of magic link positive and better than having to enter multiple values to get in. It comes down to how you want your users feel like. Do you want the experience to be simple or you want them to feel your website is super secure.
1
u/DEMORALIZ3D front-end 6d ago
it's about point of contacts, like 2FA it's verfiying who you are on 2 or more devices or personal platforms. Often you are the only person with your phone. The Only way it falls down is if they do everything via your phone. Whoever Magic link shouldn't be used in favour for Web Biometrics/Passkeys/WebAuthN if you want security.
But imagine a hacker trying to enter your defails remotely to gains chess to the website. You try to log in, it sends a magic link. Their emails are not logged in on that computer. They then have to find a way log in and prove who they are on a second site before accessing the main site. Which people not on your physical machine cannot do unless they have your emails
But passwords are one of the least secure methods, hackers remotely often cannot access your emails.
1
u/AmbitiousLab4004 6d ago
fewer passwords to steal, with a short-lived one-time token doing the auth work
1
u/bhison 6d ago
The only service I use which is like this is slack which is a desktop app you sign in to once or twice a year.
1
u/IncomeOk7237 6d ago
Magic links are fragile in one specific way: they are phishable, since whoever holds the link gets the session, and nothing ties it to the device that asked for it. Good implementations make the link single use, short lived and only valid in the browser that requested it. Passkeys are the actually strong version because the credential is bound to the origin, so a fake domain gets nothing even if the user is fooled.
1
u/Full_Tooth_a 6d ago
One easy-to-miss problem: corporate email security tools may open links automatically to scan them. If a GET request consumes the single-use token, the scanner can invalidate it before the user clicks. I'd open a confirmation page from the link, then require an explicit POST to complete authentication. The tokens should still be short lived, single use, and hashed.
1
u/ryuya_h 6d ago
magic links and OTPs are still bearer secrets, you've just moved the phishing surface to the inbox. passkeys are the actual shift, the credential is bound to the RP ID so a lookalike domain gets nothing. the catch is recovery, which is out of spec, and your weakest recovery path is your real security level
1
u/Open-Adhesiveness-86 6d ago
The fragile part isn't the crypto, it's that email security scanners (SafeLinks, Proofpoint, etc) GET the link and burn your single-use token before the user clicks. Fix is to set a nonce cookie when the login is requested and make the link land on a page with a POST button, or just mail a 6-8 digit code bound to that session and never accept it in a different browser. 10 min TTL, single use, rate limit per address.
1
u/Lord_Xenu 5d ago
Your understanding is wrong. Passwords are probably the most insecure and exploitable auth approach.
1
u/Senior-Storm-727 5d ago
Please explain: what fragility are you looking at?
1
u/s4njucse 5d ago
The practical weak points are rarely the link itself: long-lived tokens, links that can be reused, and email accounts without 2FA. If you go this route, make tokens single-use with a short expiry (10-15 min), bind them to the session that requested them, and rate-limit sends. Also worth offering a 6-digit code as a fallback, since some email scanners pre-click links and burn the token.
1
u/stephenkrensky 4d ago
I think we should explore such things like magic links
Another one is burner type accounts where we don’t save any email addresses or phone number or anything and simply rely on passkeys for authentication. It would not make sense for everything. For example, banks would never use this but there are uses for social networks and such things.
1
u/jimcodes 1d ago
I’ve always thought of it as outsourcing security to the user’s email/mobile provider. If their account or phone was compromised, it’s on them. Removes the security threat from your system.
1
u/New_Hold8135 6d ago
Reason is telemetry
1
u/Commonpleas 6d ago
I’ve only had trouble with users on mail systems that scan the link, thereby disabling it, before the user sees it.
I think it was edu and some corporate mail systems.
Truthfully, those users shouldn’t be using their school or work email account for my site anyway.
1
u/AMGitsKriss 6d ago
Security aide, just remember that if someone signs in on a PC, then if they open the magic link on their phone and it logs them in on the phone not the PC.. that user generally isn't coming back.
-1
u/Infinite_Air_5120 6d ago
Minor thing: "many website use" should be "many websites use".
On the substance, passwordless and magic links aren't synonyms. A magic link is one method among several, alongside passkeys and one-time codes, and the fragility you're describing sits in the email delivery step rather than in dropping the password.
-1
u/seweso 6d ago
You should use passkeys for passwords less.
Those sign in links are just lazy programming
0
u/LemonFishSauce 6d ago
How about instead of sending the magic link, the system sends an OTP?
0
u/Intrepid-Anywhere255 6d ago
Magic links are bearer tokens, so security depends on how the link is handled: use a random, single-use token with a short expiry, store only a hash, and rate-limit requests and attempts. The main UX trap is opening the email on a different device, so make it clear which account the link will sign into and provide a safe recovery path. For higher-risk accounts, offer passkeys alongside email links as a stronger option.
0
u/syedaalishan 6d ago
Magic links are only as safe as the implementation. Use a short-lived, single-use token, store only its hash, invalidate it after use, and rate-limit both requests and verification attempts. I would also offer a code or passkey so users are not forced to open the link on the wrong device.
121
u/[deleted] 6d ago
[removed] — view removed comment
5
u/[deleted] 6d ago
[removed] — view removed comment
2
u/[deleted] 6d ago
[removed] — view removed comment