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/

Microsoft says its AI tool is better than doctors at diagnosing conditions

https://zordt.com/
1•vchilkuri•1m ago•0 comments

Someone leaked a Mass Effect 5 trailer and now I feel worse

https://www.pcgamer.com/games/mass-effect/someone-leaked-a-mass-effect-5-trailer-and-now-i-feel-e...
1•evo_9•3m ago•0 comments

Nvidia launches Minerva to catch failing parts in giant AI data centres

https://thenextweb.com/news/nvidia-minerva-aiops-ai-factory-monitoring
2•PicardManeuver•5m ago•0 comments

Electron microscope- What it takes to run in your garage

https://www.youtube.com/watch?v=wD1YGVwL418
2•oliculipolicula•5m ago•0 comments

This I Believe

https://www.awakin.org/v2/read/view.php?tid=468
1•ctoth•7m ago•0 comments

Building Laminar: Ramp's Managed Agents Platform

https://builders.ramp.com/post/building-laminar
1•gmays•7m ago•0 comments

Show HN: bonds – not an agent, a friend with superpowers for Gen Z group chats

https://bonds.chat/
1•juanchoabdon•23m ago•1 comments

Reverse Engineered Onshape for MCP Server

https://github.com/godbrigero/onshape-native
2•godbrigero•28m ago•1 comments

Nvidia Ampere GPUs got unlocked/exploited

https://github.com/Zagitta/gpu-unlock/blob/main/docs/How%20Ampere%20was%20unlocked.md
1•Zagitta•29m ago•0 comments

Meta's Hunt for AI Capital Strikes a Raw Nerve on Wall Street

https://www.wsj.com/finance/stocks/metas-hunt-for-ai-capital-strikes-a-raw-nerve-on-wall-street-e...
3•cdrnsf•36m ago•0 comments

We Spoke with Entrepreneurs Living the "7 Vibe 3" Lifestyle

https://cadence.moe/blog/2026-09-10-we-spoke-with-entrepreneurs-living-the-7-vibe-3-lifestyle
1•Cknight70•43m ago•2 comments

Humming: Fast, Flexible Kernels for Quantized Inference

https://vllm.ai/blog/2026-10-21-humming
1•gmays•44m ago•0 comments

Red-Teaming OpenAI's Internal Agent Monitoring Systems

https://blog.redwoodresearch.org/p/red-teaming-openais-internal-agent
1•btown•45m ago•0 comments

Offline FairPlay DRM Decryption

https://github.com/EthanArbuckle/fairplay-decrypt
1•sjtgraham•47m ago•0 comments

AI Keeps Getting Better. Why Is Its Writing Still So Bad?

https://greyenlightenment.com/2026/10/21/ai-keeps-getting-better-why-is-its-writing-still-so-bad/
2•paulpauper•49m ago•1 comments

The State of PyTorch 2026

https://techstrong.ai/articles/the-state-of-pytorch-2026/
1•CrankyBear•51m ago•0 comments

XRP Ledger Fixes Lending Code Before the Feature Goes Live

https://coinmarketcap.com/community/post/380272949/
1•joeymabia1•51m ago•1 comments

Intel tour by Dwarkesh: What will computer chips look like in 2045?

https://www.dwarkesh.com/p/intel-tour
1•osnium123•53m ago•0 comments

Untold: Iran

https://www.untoldart.com/venice
1•linuxkernal•55m ago•0 comments

Musk Giving Tops $445M in Midterm Election Push for GOP

https://www.bloomberg.com/news/articles/2026-10-23/musk-giving-tops-445-million-in-midterm-electi...
9•pulisse•55m ago•0 comments

Quest Diagnostics (Hacked)

https://www.questdiagnostics.com/links/quanum-notice
2•tortilla•56m ago•1 comments

PointerCam, a screen recorder that zooms on clicks and writes guides

https://pointercam.com/
2•rhrahul•57m ago•0 comments

A tale of two PHP remote vulnerabilities

https://calif.io/php2shell.x/
1•wyclif•57m ago•1 comments

Go++

https://github.com/jordan-bonecutter/go-plus-plus
1•jordan_bonecut•1h ago•1 comments

Physicists trap a single antimatter particle for a month For the first time

https://www.yahoo.com/news/science/articles/physicists-trap-single-antimatter-particle-150000058....
1•thunderbong•1h ago•0 comments

Demis Hassabis shortens AGI timeline from five to two to three years

https://the-decoder.com/deepmind-founder-hassabis-shortens-agi-timeline-from-five-to-two-to-three...
2•brandonb•1h ago•2 comments

Peter Thiel breaks with Trump over Iran war: 'We should not have done it'

https://www.politico.com/news/2026/10/21/peter-thiel-trump-iran-war-01131284
4•wslh•1h ago•0 comments

Assure – formal verification for every PR

https://symbolia.ai/
2•Veloc1te•1h ago•0 comments

Show HN: Supastack – Cross-Platform Turborepo for Next.js, Expo, and Tauri

https://supastack.dev
1•Learnmore_smart•1h ago•0 comments

CVE Tracker

https://cve.0xosprey.com/
1•mtweak•1h ago•0 comments