TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What's (in your opinion) the best authentication method for web apps?

26 pointsby zimnickico11 months ago
i&#x27;m looking to gather some opinions, as i&#x27;ve been building some small apps recently and noticed some dissatisfaction around using magic links for authentication.<p>at the same time, i do not want to use google despite being very simple, just because they already have enough data on me as it is.<p>do people mind email and password combos? or perhaps passkeys are the future?

19 comments

andrewmcwatters11 months ago
Seriously just learn how to use and store a password hash and generate, store, and send a session id by cookie.<p>Kids are turning to services to do for them what has been a basic practice for decades.<p>Passwords are never going anywhere. Users are confused by passkeys, and they’re a terrible idea and terribly implemented anyway.<p>Edit: Learn how to use scrypt, learn how to execute `INSERT INTO users …`, and call a session library.
评论 #40877565 未加载
Maro11 months ago
I like to use passwordless email-auth, ie. send a magic link over email, they click it, and it cookies them, making them authenticated for some reasonable amount of time (like 1-7 days). Obviously not strong enough for important things like banking, but for small apps used by a couple of people, it&#x27;s fine.<p>Another layed of meta-security I like to use for private apps is to use a service like ipapi.co to do an IP-&gt;geo lookup, and then have a per-used list of allowed geo regions (usually at the city level), like:<p><pre><code> { &quot;jane@gmail.com&quot;: [&quot;New York&quot;], &quot;john@hotmail.com&quot;: [&quot;Clowntown&quot;, &quot;Buffoonville&quot;], ... } </code></pre> Depending on your user-base, this effectively shuts out 99%+ of the Internet. This geo check is trivial to circumvent if somebody really wants to, but it&#x27;s good for keeping out 99% of random hackers.
评论 #40876663 未加载
评论 #40876714 未加载
kennu10 months ago
Being used to automatic instant login with 1Password on most websites, forced magic email links are very frustrating. They make you switch windows, wait for the email to arrive, sometimes look for it in the spam folder, and finally also leave an unnecesary browser tab open. In my view, you should always offer a username&#x2F;password&#x2F;totp or at least passkey alternative.
PeterWhittaker11 months ago
If you accept id+password, either you are storing them, in which case you are a target (prepare to be boarded), or someone else is. If someone else is, you might as well use OAuth, and allow a choice of provider, but the integration effort is non-trivial (but far less than protecting your site against those looking to breach your hoard of stored treasure, other people’s passwords).<p>The other alternative is to support TOTP and let people use whatever authenticator they want.
评论 #40878841 未加载
评论 #40880760 未加载
darajava11 months ago
What’s the problem with magic links? If you have username&#x2F;password combined with a “forgot password” feature, it’s the same as magic links with far more steps.<p>Also, usernames are generally a bad idea. Just use email. If they need a handle let them set it separately on their account and keep it away from auth.
评论 #40877354 未加载
评论 #40879282 未加载
评论 #40880317 未加载
schmookeeg10 months ago
I increasingly favor OAuth when I encounter the option, even though I resisted at first (&quot;too many eggs in the google basket&quot;).<p>I am sick and tired of needing to conjure a unique 12-character password with 4 different keyset features in order to gain access to a coupon-clipping site, someone&#x27;s blog about bundt cakes, or a forum discussing solar panels.<p>The exception is where loss of the credentials can do me real and meaningful financial harm. I have no problem managing unique, complex, and rotated passwords for these. I also expect 2FA for these at a minimum.<p>Everyone is doing this so terribly that I wish they&#x27;d all just farm it out. correct battery horse staple indeed. :)
kmarc11 months ago
I hate those magic links, other stuff I have to open my email for. Same as TAN &#x2F; similar &quot;SMS&quot; auth crap.<p>I just want to Command-Shift-L to autofill my username&#x2F;password and if it needs an OTP then press Command-V to populate that too. This works with Bitwarden, on many &quot;boring&quot; websites. Unfortunately, does not with these fancy &quot;enter your email first, and THEN we slide out the textbox with a slow animation just to break your flow&quot; BS.<p>And no, I do not want to connect my github &#x2F; gmail &#x2F; twitter &#x2F; microsoft &#x2F; whatever account with any webpages. I have a password manager, and I have separate passwords (and sometimes emails) for the different websites.
Arch48511 months ago
I&#x27;m on team magic links. Security can be greatly improved with 2FA, and for those who hate magic links&#x2F;2FA, passkeys are a nice alternative.
solardev11 months ago
I like it when sites give me options. Sign up or in with any combination of email, social, Github, etc. Afterward I can add a passkey or 2fa if I want to.<p>With a password manager it&#x27;s all pretty straightforward.<p>I hate magic links. Way too many steps and have to wait for the email to transit the internet. It&#x27;s as bad as a forgotten password, except it&#x27;s every single time.
verdverm11 months ago
OAuth with the major options is the way to go. It&#x27;s my preferred method of logging in because I don&#x27;t need another set of credentials. Keycloak can be a great way to manage this for many apps that need OAuth.<p>Magic links, as you have noticed, are not what people want. I walk away from those sites that use them, just give me oauth
GauntletWizard11 months ago
I like Oauth, I like x509 even more. I don&#x27;t like Passkeys, which are an attempt to decomplicate x509 by hiding them under layers - The abstraction is by necessity leaky enough that passkeys are more complex for users to understand, and they&#x27;re a combination of too many different technologies and modes.
spdustin11 months ago
Was really hoping that Passkeys would already be in the comments, so I&#x27;ll throw that into the mix myself.<p>Passkeys.
评论 #40880352 未加载
sb824411 months ago
I don&#x27;t mind email and password. With password managers it&#x27;s really not a thing I think much about.<p>Depends on what you&#x27;re building though. Enterprisey customers will often require SSO and Google OAuth tends to keep them happy enough.
Dorcy6411 months ago
Diversify social logins, and let people login with Github, Microsoft, Facebook...<p>I personally don&#x27;t like opening another app to receive something that will help me login, especially since I pay for a password manager.
评论 #40877091 未加载
imclaren11 months ago
For most web apps I like magic link over email with cookie sessions that expire after 30 days. JWT for apis authorised by email magic links. No passwords to be hacked. No third party dependencies.
vdelitz10 months ago
From UX and security perspective (especially for non-technical users), passkeys will be the default login method in the near future.
exabrial11 months ago
Best? Pgp or cert auth. Not the most practical.
frizlab11 months ago
If Apple sign in is not available, I check for old-school sign up using an email. If neither are available, I do not signup.
pabs310 months ago
TLS client certs