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/

U.S. Military Helping Move 7M Bpd Out of Persian Gulf, Wright Says

https://oilprice.com/Latest-Energy-News/World-News/US-Military-Helping-Move-7-Million-Bpd-Out-of-...
1•netfortius•35s ago•1 comments

Elon Musk Becomes the First Trillionaire. Is That Such a Bad Thing?

https://reason.com/2026/06/12/elon-musk-becomes-the-worlds-first-trillionaire-is-that-such-a-bad-...
1•abc42•1m ago•0 comments

Pentagon forbids export of Apple computers

https://www.youtube.com/watch?v=OoxvLq0dFvw
1•Ecco•2m ago•1 comments

Zig: Extend @Vector for SPIR-V

https://codeberg.org/ziglang/zig/issues/35376
1•tosh•2m ago•0 comments

Wifärt Gallery

https://wifartgallery.com/
1•jasoncartwright•5m ago•0 comments

Good Design Disappears

https://hari.computer/good-design-disappears
1•andytratt•6m ago•0 comments

DVD-JEPA – a JEPA world model that dreams a bouncing DVD logo

https://dvd-jepa.vercel.app
1•mandarwagh•10m ago•0 comments

Cleve Moler (Developer of Matlab) Dies at 86

https://www.nytimes.com/2026/06/11/science/cleve-moler-dead.html
1•atan2•14m ago•0 comments

You Can Make Free Money on Polymarket. If You Know Math

https://www.nytimes.com/interactive/2026/06/12/upshot/kalshi-polymarket-prediction-markets-arbitr...
2•cainxinth•16m ago•0 comments

Introduction to the experience of rendering Arabic typography&its technical debt

https://lr0.org/blog/p/arabic/
2•bookofjoe•20m ago•0 comments

Show HN: Untyped – Voice to Email

https://play.google.com/store/apps/details?id=com.cronenka.untyped&hl=en_US
1•Cronenka•20m ago•0 comments

Resetting the Immune System

https://www.bbc.co.uk/news/articles/c4gy2d9y5z3o
1•pppone•23m ago•0 comments

Fedora 45 Considering a Lightened Grub Bootloader for Confidential Compute

https://www.phoronix.com/news/Fedora-45-Light-GRUB-For-CoCo
2•Bender•25m ago•0 comments

Nearly Everyone, Everywhere, Veers Left When Walking

https://www.nytimes.com/2026/06/10/science/humans-walking-veer-left-counterclockwise.html
2•mhb•26m ago•0 comments

Why do we need AI in project management software

https://evergantt.com/blog/2026-ai-doesnt-need-to-be-in-everything/
2•lb_john•26m ago•0 comments

Ask HN: What is the biggest pain of shipping improved versions of agents safely

1•prashar32•28m ago•0 comments

Show HN: AgentNexus – coordinate LLM agents by service boundary, not role

https://github.com/dugubuyan/agent-nexus
4•dugubuyan•35m ago•0 comments

Thoughts on AI and Jobs

https://blog.keyvan.net/p/thoughts-on-ai-and-jobs
12•k1m•39m ago•12 comments

An Interview with Intel's Kira Boyko: Xeon 6's Product Director

https://chipsandcheese.com/p/an-interview-with-intels-kira-boyko
6•lumpa•40m ago•0 comments

Show HN: A fully native offline location based music journal app app

https://apps.apple.com/us/app/reverie-fm/id6777534020
3•jeff-edmondson•41m ago•0 comments

DOE wants to build a single national platform for doing science with AI

https://cacm.acm.org/news/from-manhattan-to-genesis/
1•pseudolus•42m ago•0 comments

Sam Bankman-Fried loses bid to appeal against fraud conviction in FTX case

https://www.theguardian.com/business/2026/jun/12/sam-bankman-fried-loses-appeal
5•pseudolus•43m ago•0 comments

Nuclear clocks tick for the first time

https://phys.org/news/2026-06-nuclear-clocks.html
3•haeseong•45m ago•0 comments

Yann LeCun: World Models: Enabling the Next AI Revolution

https://www.youtube.com/watch?v=72Xj8k5WQX4
2•root-parent•46m ago•0 comments

Claude Corps

https://www.anthropic.com/claude-corps
1•hmokiguess•48m ago•2 comments

Show HN: 2 Weeks of Hallucinate – The Photo Gallery

https://hallucinate.site/gallery
22•stagas•49m ago•5 comments

AI OSS tool repo goes archived over night after raising $7.3M Seed

https://github.com/tensorzero/tensorzero
2•hek2sch•49m ago•1 comments

Implementing dark mode with standard CSS

https://olliewilliams.xyz/blog/dark-mode/
2•llcooliovice•51m ago•0 comments

Apple Lisa Emulator in Rust/WebAssembly

https://old.reddit.com/r/ClaudeCode/comments/1u4opmn/apple_lisa_emulator_in_rust_and_webassembly_...
2•adam_jesion•52m ago•0 comments

0xSero on X: "Open Source must win

https://twitter.com/0xSero/status/2035022588439581076
1•bilsbie•52m ago•0 comments