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/

Man nearly sucked out of 'detached' window on Ryanair flight

https://www.france24.com/en/live-news/20260710-man-nearly-sucked-out-of-detached-window-on-ryanai...
1•jacquesm•52s ago•0 comments

AI Surveillance and Social Progress

https://www.schneier.com/blog/archives/2026/07/ai-surveillance-and-social-progress.html
1•cdrnsf•1m ago•0 comments

Gary Kildall's Death Investigation

https://dfarq.homeip.net/gary-kildalls-death-investigation/
1•jnord•2m ago•0 comments

Polymarket Seeks License to Offer Margin Trading Legally in US

https://www.bloomberg.com/news/articles/2026-07-09/polymarket-seeks-license-to-offer-margin-tradi...
1•thm•2m ago•0 comments

Could We Mitigate Super El NiñOS by Artificially Changing the Climate?

https://www.smithsonianmag.com/smart-news/could-we-mitigate-super-el-ninos-by-artificially-changi...
1•gotmedium•3m ago•0 comments

80-year-old woman with Alzheimer's took mushrooms and started speaking again

https://www.microdos.in/en/research/alzheimers-case-report-psilocybin-speech
2•LaurensDerisks•5m ago•0 comments

Ask HN: What model/AI platform do you use for the automatic translations?

1•cristaloleg•7m ago•0 comments

The Update Framework (TUF)

https://apis.io/providers/tuf/
1•ankitg12•8m ago•0 comments

Ask HN: Who knows someone at GitHub/NPM team?

2•punkpeye•11m ago•0 comments

'Complex numbers are not needed for quantum mechanics'

https://www.livescience.com/physics-mathematics/complex-numbers-are-not-needed-for-quantum-mechan...
2•bookofjoe•15m ago•0 comments

GPS Camerastamp Photo

https://play.google.com/store/apps/details?id=com.gpsmapcamera.timestamp.geotaglocation.video&hl=...
1•karlnelsone•16m ago•1 comments

Stardew Valley Mod Enables 3D and VR

https://www.rockpapershotgun.com/stardew-valley-enters-the-third-dimension-thanks-to-this-in-deve...
2•makaimc•16m ago•0 comments

Show World

https://zenodo.org/records/21294371
1•mbinatorom•16m ago•0 comments

Show HN: TTSC, TypeScript v7 ToolChain, plugin and codegraph reducing 90% tokens

https://github.com/samchon/ttsc
1•autobe•22m ago•0 comments

Email link phishing: why your email app should always show the URL

https://www.phpfreelance.co.uk/blog/email-link-phishing-your-app-should-always-show-the-url
1•vcdk•26m ago•0 comments

Mini Shai-Hulud: Where SLSA's Boundaries Fall

https://slsa.dev/blog/2026/05/mini-shai-hulud-what-slsa-can-and-cannot-do
1•ankitg12•27m ago•0 comments

TV Time is shutting down. The alternatives are buckling

https://reacham.app/demand-leaks/tv-time
1•neddinn•27m ago•1 comments

AB 2047: California's 3D Printer Surveillance Bill Advances

https://reclaimthenet.org/california-wants-a-watcher-inside-every-3d-printer
2•bilsbie•29m ago•0 comments

Modern environment designs overstimulate the brain, causing discomfort, stress

https://www.stir.ac.uk/news/2026/july-2026-news/looks-good-feels-bad-stirling-led-review-explains...
1•giuliomagnifico•30m ago•0 comments

EU Commission: addictive design Instagram and Facebook in breach of the DSA

https://ec.europa.eu/commission/presscorner/home/en
4•jeroenhd•30m ago•1 comments

Show HN: The Flint Programming Language

https://github.com/flint-lang/flintc
2•zweiler1•30m ago•0 comments

Meta risks $12B EU fine over addictive Instagram and Facebook feeds

https://www.theverge.com/policy/963872/meta-eu-addictive-design-200b-fine-risk-digital-services-a...
2•ilreb•31m ago•0 comments

Size Does Matter

https://nh3.dev/blog/05-bloat
1•cristaloleg•31m ago•0 comments

Cybersecurity Startup Publishes Infostealers to NPM

https://opensourcemalware.com/blog/cybersecurity-startup-publishes-infostealers-to-npm
2•ledoge•32m ago•0 comments

China tests sea-based rocket booster recovery system

https://www.reuters.com/science/china-successfully-tests-sea-based-rocket-booster-recovery-system...
2•olalonde•36m ago•0 comments

The Road to Iroh 1.0

https://www.iroh.computer/blog/the-road-to-iroh-1-0
1•pimterry•37m ago•0 comments

Show HN: Concepticon – manage your team's domain language like source code

https://thinkingtools.software/concepticon/
1•james_ross•37m ago•1 comments

Brown says AI make student brain no work good, teacher should help use it better

https://www.theregister.com/ai-and-ml/2026/07/09/brown-says-ai-make-class-dumb-teacher-must-help-...
1•pseudolus•38m ago•1 comments

Igloo Inc

https://www.igloo.inc/
2•treexs•39m ago•0 comments

20M data entries, a backtest engine, ML models, agents. Still haven't traded

https://demo.botlance.ai/
1•lamne•43m ago•0 comments