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/

Peter Thiel's private society attendance list leaked via hard-coded HTML

https://github.com/nzaki-dev/dialog
1•helloamigo•5m ago•0 comments

TradersCompanion, a trading journal that helps prop firm traders pass challenges

https://www.traderscompanion.org
1•mathono•5m ago•0 comments

Tell HN: Just scammed for $5207.11 by "10-4 by WEX" (Mercury Personal)

1•bojangleslover•5m ago•0 comments

Britain arrests more for social media posts than China, Russia, Turkey combined

https://twitter.com/XFreeze/status/2066778611227709885
3•Dig1t•12m ago•0 comments

A primer on cloud seeding (2024)

https://www.theclimatebrink.com/p/a-primer-on-cloud-seeding
1•sneela•12m ago•1 comments

Cursor CEO omits information geometry contraints helping programming activity

https://twitter.com/a16z/status/2066932717871301046
1•__patchbit__•15m ago•0 comments

India temporarily bans Telegram over exam paper leak concerns

https://www.bbc.com/news/articles/cn074j04l3eo
1•thisislife2•16m ago•0 comments

BoronEngine, (c++ vulkan dx11) gameengine

1•Kahviz_•19m ago•0 comments

Show HN: Product Validation

https://ideas.trk7.app/
2•cosmok•22m ago•0 comments

Zygohistomorphic Prepromorphism Is All You Need

https://wiki.haskell.org/index.php?title=Zygohistomorphic_prepromorphisms
2•wseqyrku•24m ago•0 comments

Bill Joy: Co-Founder of Sun Microsystems

https://engineering.berkeley.edu/bill-joy-co-founder-of-sun-microsystems/
3•teleforce•27m ago•0 comments

Apple plans change to Hide My Email that could make it less effective

https://techcrunch.com/2026/06/16/apple-plans-to-change-its-hide-my-email-privacy-feature-that-co...
5•memalign•34m ago•0 comments

European leaders meet with the Trump and Amodei over Fable 5

https://www.politico.eu/article/eu-donald-trump-anthropic-amodei-row-at-g7/
2•jonash54•35m ago•0 comments

Dancing the Limbo

https://schrottner.at/2026/06/14/Dancing-the-limbo.html
2•RyeCombinator•39m ago•0 comments

Show HN: Convert the raw HealthKit DB from an iPhone backup to SQLite

https://github.com/ninyawee/healthkit-from-backup-to-sqlite
1•circleoncircles•40m ago•0 comments

Saddam husseins love of masgouf got him caught

https://www.godreports.com/2015/04/saddam-husseins-appetite-for-fish-led-to-his-capture/
1•marysminefnuf•40m ago•1 comments

Building an LLM safe design system

https://polar.sh/blog/orbit-llm-safe-design-system
1•SouravInsights•42m ago•0 comments

People Paying $59 to Make Phones Worse. Speaks Volumes About Tech World

https://www.inc.com/connor-jewiss/people-are-paying-59-to-make-their-phones-worse-the-reason-why-...
4•1vuio0pswjnm7•43m ago•1 comments

Anthropic Is Still at Odds with the White House over Claude Fable 5

https://www.wired.com/story/anthropic-is-still-at-odds-with-the-white-house-over-claude-fable-5/
1•dstala•47m ago•0 comments

The B2C-or-B2B decision you're forced to make too early

https://www.indiehackers.com/post/the-b2c-or-b2b-decision-youre-forced-to-make-too-early-and-why-...
1•DharmendraJago•50m ago•0 comments

Murmer – An experiment in bringing Elixir's actor model to Rust

https://paxsonsa.github.io/murmer-rs/
2•paxsonsa•54m ago•1 comments

GLM-5.2

https://huggingface.co/zai-org/GLM-5.2
4•gomizhuce•57m ago•1 comments

Designing the Dream House of an 87-Year-Old Tech Visionary

https://www.wired.com/story/stewart-brand-whole-earth-catalog-house-petaluma/
1•cromulent•58m ago•0 comments

Show HN: FinMind AI – what if Claude Code was built for Wall Street?

https://finmindai-moneyverse.vercel.app/
2•heroboy•1h ago•0 comments

From AI Job Board to Talent Pool and hitting $1k/mo in 6 months

https://www.indiehackers.com/post/from-ai-job-board-to-talent-pool-and-hitting-1k-mo-in-6-months-...
2•celadondev•1h ago•0 comments

Is Horsewood Safe? Understanding the Horse Wood Warning

https://finance.yahoo.com/sectors/healthcare/articles/horsewood-urgent-report-2026-horse-19110038...
1•fatnhaus•1h ago•0 comments

Asked ChatGPT, how to recover data from disk, "run wipefs"

https://chatgpt.com/share/6a322911-2f14-83e9-a357-559a6175df1e
1•TZubiri•1h ago•2 comments

A Red-Team Study of Anthropic Fable 5 and Opus 4.8 Models

https://arxiv.org/abs/2606.18193
1•ilreb•1h ago•0 comments

Intrusive Driving Aids make driving worst

https://www.youtube.com/watch?v=f-S76WEl25k
1•afarah1•1h ago•0 comments

Looped World Models

https://arxiv.org/abs/2606.18208
1•ilreb•1h ago•0 comments