frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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/

EU ban on Chinese inverters sparks strong response from Beijing

https://www.pv-magazine.com/2026/05/08/eu-ban-on-chinese-inverters-sparks-strong-response-from-be...
1•ndr42•1m ago•0 comments

Bun's experimental Rust rewrite hits 99.8% test compatibility on Linux x64 glibc

https://twitter.com/jarredsumner/status/2053047748191232310
1•heldrida•3m ago•1 comments

Steering Zig Fmt

https://matklad.github.io/2026/05/08/steering-zig-fmt.html
1•mpweiher•4m ago•0 comments

The troubled quest for tasty vegan cheese

https://www.economist.com/interactive/1843/2026/05/08/grate-expectations-the-troubled-quest-for-t...
1•pingou•5m ago•1 comments

Chrome's AI features may be hogging 4GB of your computer storage

https://www.theverge.com/tech/924933/google-chrome-4gb-gemini-nano-ai-features
1•elemar•9m ago•0 comments

Show HN: Cheapshot – GPS-based mobile game

https://cheapshot.co/
1•pakenrol•13m ago•1 comments

Autoenshittification (Background on WEI and Google Cloud Fraud Defence)

https://pluralistic.net/2023/07/24/rent-to-pwn/#kitt-is-a-demon
1•Voultapher•13m ago•1 comments

Radiolaria

https://en.wikipedia.org/wiki/Radiolaria
1•majkinetor•17m ago•0 comments

Vision: An Agent-Authored Control Architecture (Whitepaper)

https://sbarron.com/whitepapers/vision-system
1•iampneuma•18m ago•0 comments

Show HN: I Build a SaaS Loading Time Anxiety and Cost Calculator

https://vnta.agency/tools/saas-loading-time-anxiety-calculator
1•kartik_malik•28m ago•0 comments

Engineers Are Drifting

https://exhaustedmind.substack.com/p/your-engineers-are-already-drifting
1•Psychoterapist•30m ago•0 comments

Frontier plane reportedly strikes pedestrian on Denver Airport runway

https://www.cnn.com/2026/05/09/us/frontier-reportedly-pedestrian-denver-runway-hnk
1•Tomte•30m ago•0 comments

Claude Knew It Was Being Tested. Anthropic Built a Tool to Detect It

https://firethering.com/anthropic-nla-claude-thoughts-interpretability/
2•steveharing1•32m ago•0 comments

Squint

https://squint-cljs.github.io/squint/
2•Tomte•33m ago•0 comments

Elon Musk faces criminal probe in France after ignoring summons in X case

https://arstechnica.com/tech-policy/2026/05/elon-musk-faces-criminal-probe-in-france-after-ignori...
5•ndsipa_pomu•33m ago•0 comments

Export NotebookLM Responses as Properly Cited Docx/PDF [video]

https://www.youtube.com/watch?v=7jx0j9JsQ5o
2•MassiveLy_Easy•34m ago•1 comments

How to turn work into cinematic videos with NotebookLM

https://www.theaithinker.com/p/how-to-turn-work-into-cinematic-videos
1•adamfaik•37m ago•0 comments

Cloudflare Drops on Sales Forecast Miss, Job Cuts

https://www.bloomberg.com/news/articles/2026-05-07/cloudflare-forecast-misses-estimates-announces...
1•1vuio0pswjnm7•40m ago•0 comments

Plan9: The Squeal to Unix [video]

https://www.youtube.com/watch?v=mbsQCnDHkZo
1•zeristor•40m ago•0 comments

Threats by artificial intelligence to human health and human existence (2023)

https://gh.bmj.com/content/8/5/e010435
2•janandonly•44m ago•0 comments

What Does 'Depth' Mean in Mathematics?(2014) – John Stillwell [video]

https://www.youtube.com/watch?v=2jp49wGhAG8
1•nill0•44m ago•0 comments

Apple May Drop Base $599 MacBook Neo as Chip, DRAM Costs Climb

https://www.macrumors.com/2026/05/07/apple-drop-base-macbook-neo-costs-climb/
3•pjmlp•46m ago•1 comments

Mathematical Depth Workshop (2014) – Robert Geroch [video]

https://www.youtube.com/watch?v=qfuIfCI5NOw
1•nill0•47m ago•0 comments

Show HN: Dikaletus – meeting recording and transcription using Mistral AI

https://codeberg.org/MimosaDev/dikaletus
2•phillc73•47m ago•0 comments

The M:N Concurrent Model – A Complete Guide

https://0xkiire.com/mn-concurrency-model/
1•kiirecodes•48m ago•0 comments

Notes on Tanya M. Luhrmann's Book 'How God Becomes Real'

https://michaelnotebook.com/luhrmann/index.html
1•jger15•49m ago•0 comments

Cloudflare's slowing growth disappoints investors betting on AI boost

https://www.reuters.com/business/cloudflares-slowing-growth-disappoints-investors-betting-ai-boos...
3•1vuio0pswjnm7•50m ago•0 comments

Cloudflare stock sinks 24% after earnings, cuts 1100 employees due to AI changes

https://www.cnbc.com/2026/05/07/cloudflare-net-q1-2026-stock-earnings-layoffs.html
1•1vuio0pswjnm7•52m ago•0 comments

A linguist on Arrival's alien language (2016)

https://slate.com/culture/2016/11/a-linguist-on-arrival-s-alien-language.html
3•downbad_•54m ago•2 comments

Fiber optic cables can eavesdrop on nearby conversations

https://www.science.org/content/article/fiber-optic-cables-can-eavesdrop-nearby-conversations
3•signa11•58m ago•0 comments