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/

Burn Rate: The Number That Decides How Long You Survive

https://sociallinker.org/metrics-calculator
1•athrayasaas•1m ago•0 comments

Show HN: Rasterly – a cheaper screenshot and PDF API with a live demo

https://rasterly.dev/
1•latcom•1m ago•0 comments

Frameworks shipping with knowledge: benchmarking agents on one they haven't seen

https://spynejs.com/blog/frameworks-are-starting-to-ship-knowledge
1•nybatista•3m ago•0 comments

Show HN: Robot or Meatbag?

https://meatbag.atomic14.com/
1•iamflimflam1•3m ago•0 comments

Zero-copy wgpu rendering inside an Electron app

https://murlet.com/blog/rendering-wgpu-under-electron/
1•tangled•4m ago•0 comments

Show HN: A static personal site with post-quantum signed and encrypted URLs

https://diaryof.me/tools/
1•cryptographical•5m ago•1 comments

Plainhub – runway and burn from typed entries, no bank connection

https://plainhub.app/
1•byozgnn•5m ago•0 comments

Xenix, from Microsoft, in Adverts

https://retrocomputingforum.com/t/xenix-from-microsoft-in-adverts/2778
1•stikit•6m ago•0 comments

Niagara: A 32-WAY MULTITHREADED SPARC PROCESSOR (2005) [pdf]

https://web.archive.org/web/20060901143530/http://ogun.stanford.edu/%7ekunle/publications/niagra_...
1•rbanffy•8m ago•0 comments

DeepSeek Harness vs. LangChain Deep Agents – what's the actual difference?

2•sockstack•9m ago•0 comments

Show HN: I built a local-first, open-source tab manager for Chrome

https://github.com/timgioh/Tab-Shield-Saver-Protect-Stash-Tabs
1•Konstantinsio•9m ago•0 comments

Show HN: A stupid simple way to manage and publish ANY AI agents artifacts

https://docstash.ai/
1•itskishankumar•9m ago•0 comments

Meta pays pro-Meta influencers when countries look into teen safety on Instagram

https://www.theguardian.com/technology/2026/aug/18/meta-pays-influencers-teen-social-media-ban
3•mikelgan•10m ago•1 comments

The Cop Who Took on Flock

https://www.wired.com/story/the-cop-who-took-on-flock/
1•Brajeshwar•10m ago•0 comments

Software Factories Are Distributed Systems

https://www.sjarmak.ai/writing/software-factories-are-distributed-systems/
1•sjarmak•10m ago•1 comments

Show HN: NexusMem – not a vector DB: it indexes shell exit codes and Git diffs

https://github.com/yaminbkk/NexusMem
1•yamin_bakoh•11m ago•0 comments

Mecanicien Ia – Ecommerce

https://piecemotooccasion.eu/
1•tonydevweb•12m ago•0 comments

We Should Start Preparing for Human Resurrection

https://joshbocanegra.medium.com/we-should-start-preparing-for-human-resurrection-6624031a990b
1•jbai•12m ago•0 comments

DeepSeek Harness

https://github.com/deepseek-ai/deepseek-harness
1•SweetSoftPillow•13m ago•0 comments

Show HN: Countinghouse– MCP tools that call each other in-process, not via model

https://mchen6.github.io/countinghouse/
1•out4b•14m ago•0 comments

Claude Text Watermark: Reconstruction, Not Hidden Characters

https://aitextwatermarkremover.com/blog/claude-official-text-watermark
1•wangneo276•14m ago•0 comments

Git Forge on Durable Objects

https://git.littledivy.com/dgit/about/
1•undefined_void•15m ago•1 comments

Installing Arch Linux on a Framework Laptop

https://hack.rest/repeat
1•kaishiro•16m ago•0 comments

MIT engineers connect bacteria to create living transistors

https://news.mit.edu/2026/mit-engineers-connect-bacteria-to-create-living-transistors-0817
1•bookofjoe•16m ago•0 comments

Hacking your life with AI can get you hacked – Research

https://www.endorlabs.com/learn/hacking-your-life-with-ai-can-get-you-hacked
1•p80n•17m ago•0 comments

UI SFX - Open-source interface sound effects

https://github.com/romainsimon/uisfx
1•agilek•18m ago•0 comments

Learn People's Names

https://justismills.substack.com/p/learn-peoples-names
2•surprisetalk•18m ago•0 comments

Star Citizen has a disastrously laggy stream with horrendous vibes

https://www.pcgamer.com/games/mmo/star-citizen-has-a-disastrously-laggy-stream-with-horrendous-vi...
1•evo_9•19m ago•0 comments

Agent identity, plus context and memory: three IANA-registered formats

https://zenodo.org/records/21951641
2•wolfejam•19m ago•1 comments

Python Polars Cheatsheet (based on our O'Reilly book)

https://opensource.posit.co/resources/cheatsheets/polars/
6•jeroenjanssens•21m ago•1 comments