frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: Why is web auth not a solved issue?

2•zwnow•1y ago
Personally, every project I start, I quit due to not being comfortable with the auth implementation.

I've been into web development for 4 years now. During my research regarding auth in this timeframe, I have found a million reasons on why I should not roll it myself. The reason is always it being to difficult to implement, too much responsibility and basically no matter how I'd do it, it would be unsafe.

The general consensus among web developers seems to be to just let a third party do it. And I understand the reasoning, they are experts and have decades of experience on that specific thing. It makes sense as long as you're fine with third party service dependencies for your application. However, I don't want that. I do not feel comfortable submitting my users data to tech giants for obvious reasons.

I am wondering why it's so difficult to implement secure auth? Why can frameworks like Laravel or Phoenix just generate auth solutions? Why should I trust them, if everyone is saying I shouldn't roll it myself?

After all, if Laravels or Phoenix generated auth isn't safe, I am the one taking responsibility anyway, no?

To my understanding web auth has been an issue for decades now, why aren't there protocols in place to solve it? Or if they are, why aren't they talked about a lot?

Considering how often I read about auth breaches with the big players in the game (Firebase as an example) I am not comfortable trusting third parties with that task either.

So how is one supposed to do it? There are so many JWT tutorials on youtube, but apparently JWTs aren't safe either. Then there are session cookies, which also aren't safe? Why is that?

I am also not talking about authorization. I specifically mean authentication. If I wanted a micro blog platform where users can log into their accounts and write about stuff, how would I make sure it's secure without having to trust third parties, especially big tech companies who repeatedly prove they cant be trusted over and over again?

Comments

arrowsmith•1y ago
> if Laravels or Phoenix generated auth isn't safe

What makes you think they're not safe? Zillions of successful apps have been built using Laravel and Phoenix and (afaik) no-one has hacked their auth code yet. The code is open-source for anyone to inspect for vulnerabilities. I wouldn't feel unsafe using them.

You seem to misunderstand what it means to "roll your own auth".

"Don't roll your own auth" doesn't mean "use a third-party auth provider". It means "use an existing, expert-made auth solution and don't try to write it yourself."

That can be a third-party provider like Firebase, it can be a code dependency like Rails's Devise, it can be generated by `phx.gen.auth` in Phoenix, it doesn't matter - the point is that you're using a tried-and-tested auth solution written by someone who knows what they're doing.

Writing your own auth code is generally a bad idea because it's complicated, time-consuming and easy to get wrong. But there are zillions of off-the-shelf solutions you can use that have been created by security experts and battle-tested in thousands of production apps. As far as I'm concerned, web auth is a solved problem.

zwnow•1y ago
Interesting. When I generate auth for Phoenix the API endpoints are not piped through any security pipes. Only the browser endpoints. Why wouldn't I secure my API endpoints? The same kind of requests that are made for browser requests are sent to the API routes, so this is really confusing.
arrowsmith•1y ago
Ah yes. `phx.gen.auth` generates a cookie-based auth system, which is fine for the :browser pipeline but it's not generally what you want for a JSON API.

The Phoenix docs include a suggestion for how you can extend `phx.gen.auth` to add token-based authentication to your API: https://hexdocs.pm/phoenix/api_authentication.html

(No, this isn't "rolling your own auth" either, it's using someone else's pre-written auth code.)

johncoltrane•1y ago
> The general consensus among web developers seems to be to just let a third party do it.

Outside of personal projects, third-party auth providers must be audited (think GDPR or PIPL), budget must be allowed, contracts signed, etc. so web developers rarely, if ever, have their say on the matter. The decision is taken long before anyone wrote a single line of code. From a project management perspective, it's an easy trade-off to make: one sprint for integrating Okta versus who knows how many for badly implementing something that requires a level of expertise that no one on the team has reached.

For personal projects, the trade-off is a bit different. Resources are scarce so, even if implementing auth is actually not very complicated(1) and can even be quite fun, there are probably more immediately interesting things to do. So you integrate a third-party solution in a wednesday night and you move on.

[1] https://thecopenhagenbook.com/

Pakistan Orders Hospital Beds Clear for Mass Casualty Ahead of Protest

https://www.dropsitenews.com/p/pakistan-military-protest-imran-khan-sisters-detained-hospitals-beds
1•xbmcuser•14s ago•0 comments

Ask HN: Is Astra's writing starting to bother anyone else?

1•demibabs•22s ago•0 comments

QBZ (Qobuz desktop client for Linux) shutting down

https://qbz.lol/
1•herrherrmann•1m ago•0 comments

Show HN: Cheap and easy throwaway VPN server

https://a.l3x.in/blog/throwaway-vpn/
1•alexfortin•5m ago•0 comments

AI staff complain of mental toll over fears of threat to society

https://www.ft.com/content/60870960-f433-48ca-bc2c-708686a69ae7
2•bazzmt•7m ago•0 comments

Where Improvement Becomes the Problem

https://medium.com/@gurvinder372/article-22-where-improvement-becomes-the-problem-f2c1f3671eaa
1•gps372•8m ago•0 comments

Bk2204/talk-rust-in-Git: GitHub repository with SHA-256 commit IDs

https://github.com/bk2204/talk-rust-in-git
1•gotosun1•9m ago•0 comments

The Ultimate Reading List for Founders

https://grafista.io/blog/posts/the-ultimate-reading-list-for-founders
1•GiorgosGennaris•10m ago•0 comments

Complex KDA:Understanding and Enhancing the Expressivity of Kimi Delta Attention

https://arxiv.org/abs/2609.24797
1•jul8234•10m ago•0 comments

CP/M-80 2.2 Compilers

https://medium.com/@davidly_33504/cp-m-80-2-2-compilers-91958a8f1d58
1•rbanffy•11m ago•0 comments

How Claude is uplifting biomolecular modeling

https://www.anthropic.com/research/claude-uplifts-biomolecular-modeling
3•gmays•11m ago•0 comments

Beyond Context Windows: Evaluating Long-Term Memory for AI Agents

https://twitter.com/AgentMemoryL/status/2101312784688726331
1•IreneAI•17m ago•0 comments

A Summer of AI Optimization

https://lemire.me/blog/2026/09/22/a-summer-of-ai-optimization/
1•chmaynard•20m ago•0 comments

Be the first human to review your own code

https://abhinavr.me/posts/be-the-first-human-to-review-your-own-code/
1•avr5500•22m ago•0 comments

AMD has now officially joined the trillion-dollar club

https://companiesmarketcap.com/amd/marketcap/
2•AbuAssar•32m ago•1 comments

Axon Training Pod (ATP) VR for training police officers

https://www.axon.com/products/axon-training-pod
2•nephihaha•34m ago•0 comments

GeoRisk Trace – An evidence-gated agent that abstains on unsupported risk paths

https://github.com/ViviLoveAI/GeoRiskAgent
1•ViviLoveAI•34m ago•0 comments

When Pixels Collide – The Story of Reddit's Place (2017)

https://web.archive.org/web/20170409173246/http://sudoscript.com/reddit-place/
1•pmlnr•35m ago•0 comments

Speechify for Cartesia Users

https://chromewebstore.google.com/detail/lisen-free-read-aloud-wit/jjglbebakkebkafjilbfnejmgpdphbhp
1•theaugustin•36m ago•0 comments

Windows Exploitation Techniques: Dangling COM Object Registrations

https://projectzero.google/2026/09/windows-dangling-com.html
1•mfrw•36m ago•0 comments

What you can build with TypeSafe AI Jev

https://vercel.com/i/jev-use-cases
1•flashbrew•41m ago•0 comments

Deploy Drunk

https://korshakov.com/posts/deploy-drunk
1•denysvitali•43m ago•0 comments

Genesis – The Bible verse that far-right Americans misinterpret to defend Israel

https://www.trtworld.com/article/5081f8ade0cf
3•timeoperator•44m ago•0 comments

Keep Using Your Intel Mac in 2025?

https://aslihan.live/posts/why-intel-mac-in2025/
2•aslihana•46m ago•2 comments

AMD briefly joins the $1T club

https://www.theregister.com/systems/2026/09/21/perpetual-underdog-amd-nips-at-nvidias-heels-as-it...
3•mdp2021•49m ago•0 comments

Can gzip be a language model?

https://nathan.rs/posts/gzip-lm/
2•networked•49m ago•0 comments

Daily Geography Adventures

https://maptap.gg/
1•yitchelle•51m ago•0 comments

Mirror Node Reconnaissance

https://sgaillabs.com
1•sgaillabs•55m ago•0 comments

How AI Creates a Capability Mirage

https://sloanreview.mit.edu/article/how-ai-creates-a-capability-mirage/
1•ventana•55m ago•1 comments

PyTorch Written in C

https://github.com/thevoxium/bare-lm
1•docuru•55m ago•0 comments