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/

Why Dunkin' Donuts Failed in India

https://timesofindia.indiatimes.com/life-style/food-news/why-dunkin-failed-in-india/articleshow/1...
1•paulpauper•10s ago•0 comments

RAG Eval Comparing Vertex/Bedrock/Azure/OpenAI

https://github.com/colon-md/retrievalci
1•colon-md•42s ago•1 comments

Codex Pets for People in a Hurry

https://www.augmentedswe.com/p/how-to-use-codex-pets
1•wordsaboutcode•2m ago•0 comments

Graft – semantic memory for AI agents, without the LLM

https://github.com/AEndrix03/Graft
1•AEndrix03•2m ago•0 comments

Onboarding with LLMs

https://newsletter.eng-leadership.com/p/how-to-use-ai-to-onboard-into-a-codebase
1•wordsaboutcode•3m ago•0 comments

A Wild Ghost Blog Appears

https://allenc.com/a-wild-ghost-blog-appears/
1•allenc•11m ago•1 comments

Thinking Machines: AI that can respond during the interaction

https://medium.com/seeds-for-the-future/a-new-way-to-interact-with-ai-interaction-models-2941f173...
2•hungryclaw•19m ago•0 comments

Can we code our way out of gentrification?

https://www.freerange.city/p/can-we-code-our-way-out-of-gentrification
2•burlesona•22m ago•0 comments

Mistral AI's NPM package was compromised

https://github.com/mistralai/client-ts/issues/217
1•logickkk1•31m ago•0 comments

Senior Product Engineer

https://revieve.factorialhr.com/job_posting/product-engineer-299899
1•seharetimad•35m ago•0 comments

Brain scans reveal how people with autistic traits connect differently

https://www.psypost.org/brain-scans-reveal-how-people-with-autistic-traits-connect-differently/
1•1317•37m ago•0 comments

Linux bitten by second vulnerability in as many weeks

https://arstechnica.com/security/2026/05/linux-bitten-by-second-severe-vulnerability-in-as-many-w...
1•jnord•37m ago•0 comments

Show HN: ProvisioningIQ – Continuous Benchmarks of AWS/Azure/GCP Latency

https://provisioningiq.appswireless.com/
1•syed786•40m ago•0 comments

Postmortem: TanStack NPM supply-chain compromise

https://tanstack.com/blog/npm-supply-chain-compromise-postmortem
6•carlos-menezes•41m ago•0 comments

Anxiety vs Depression

https://silence.bearblog.dev/anxiety-vs-depression/
2•thejamesbox•42m ago•1 comments

Legacy preference bans may not increase college diversity, researchers say

https://phys.org/news/2026-04-legacy-college-diversity.html
2•PaulHoule•42m ago•0 comments

Designing GPUs for Developers: A Conversation with Godot

https://blog.imaginationtech.com/designing-gpus-for-developers-a-conversation-with-godot
1•danbolt•42m ago•0 comments

GM just laid off IT workers to hire those with stronger AI skills

https://techcrunch.com/2026/05/11/gm-just-laid-off-hundreds-of-it-workers-to-hire-those-with-stro...
25•jnord•43m ago•22 comments

Intel Reenters DRAM Race? A Closer Look at the Z-Angle Memory

https://www.trendforce.com/news/2026/02/03/news-intel-reenters-dram-race-a-closer-look-at-the-z-a...
2•jeffufl•45m ago•1 comments

Hermes Agent Background Computer Use on macOS via SkyLight Private SPIs

https://hermes-agent.nousresearch.com/docs/user-guide/features/computer-use
1•simonpure•47m ago•0 comments

When My Father's Canary Flew Away

https://www.nytimes.com/2026/05/07/science/dementia-memory-brain-injury.html
1•gmays•49m ago•0 comments

Star Wars: Fall of the Empire by Stern Pinball

https://sternpinball.com/game/star-wars-fall-of-the-empire/
2•pentagrama•50m ago•0 comments

Why LLMs Make Learning to Code More Important, Not Less

https://senthil.learntosolveit.com/posts/2026/05/10/why-llms-make-learning-to-code-more-important...
1•orsenthil•51m ago•2 comments

What do you NOT like about Cursor / VSCode / Claude Code desktop / Codex / etc.?

1•nokturn•54m ago•8 comments

Show HN: NodeDB – High Perfomance Multi-Model Database

https://github.com/nodedb-lab/nodedb
1•fs90•55m ago•0 comments

Show HN: Inrepo – Pull upstream repos into your app without forks or submodules

https://github.com/inthhq/inrepo
1•burnedchris•55m ago•0 comments

'Not normal': one April day, planet's 50 hottest cities were in a single country

https://www.cnn.com/2026/05/11/climate/50-hottest-cities-aqi-india-heatwave
1•littlexsparkee•58m ago•0 comments

Oxide private cloud rack 3D explorer

https://explorer.oxide.computer/
2•wmf•1h ago•0 comments

Apple Releases iOS 26.5 and iPadOS 26.5 with End-to-End Encrypted RCS

https://www.macrumors.com/2026/05/11/apple-releases-ios-26-5/
1•JumpCrisscross•1h ago•0 comments

GM cutting up to 600 white-collar jobs, even as it seeks tech talent

https://www.detroitnews.com/story/business/autos/general-motors/2026/05/11/gm-to-cut-some-tech-jo...
3•littlexsparkee•1h ago•0 comments