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/

Show HN: Ekko – PQC encryption inside of your keyboard

https://useekko.app/
2•kvasilev•2m ago•0 comments

A Meta-Epistemological Reason for Rejecting AI-Written Philosophy

https://dailynous.com/2026/07/16/a-meta-epistemological-reason-for-rejecting-ai-written-philosophy/
1•zetamax•2m ago•0 comments

Flock Credibility Lost as It Repeatedly Lies to City Councils, Police, & Public

https://www.aclu.org/news/privacy-technology/tracking-alpr-cameras/flock-safety-credibility-lost-...
2•StatsAreFun•7m ago•0 comments

The surprising benefits of red light

https://www.economist.com/science-and-technology/2026/07/20/the-surprising-benefits-of-red-light
1•andsoitis•11m ago•0 comments

Quickly rewrite Git repository history

https://github.com/newren/git-filter-repo
2•modinfo•12m ago•0 comments

The Networking Wars: How Microsoft Crushed Novell

https://www.youtube.com/watch?v=5GAYaBU1SLQ
1•cable2600•13m ago•0 comments

A quick note on OmniWM, open source, and why giving credit matters

https://github.com/BarutSRB/OmniWM/discussions/497
2•mmcclure•18m ago•0 comments

Best Coding Fonts for Developers in 2026

https://www.jstools.space/blog/best-coding-fonts/
3•javatuts•19m ago•1 comments

Datasette Dashboards

https://romain-clement.net/projects/datasette-dashboards/
2•ankitg12•20m ago•0 comments

The Graph Was the Cheap Part

https://cameronwestland.com/the-graph-was-the-cheap-part/
1•camwest•20m ago•0 comments

OpenCircuitX

https://github.com/openlab-x/OpenCircuitX
2•firetesterlab•21m ago•0 comments

OpenAI Says Model Broke Out of Sandbox

https://twitter.com/kimmonismus/status/2079276434586210745
1•derangedHorse•22m ago•0 comments

$100 million for open source: A milestone built by the community

https://github.blog/open-source/maintainers/100-million-for-open-source-a-milestone-built-by-the-...
1•chmaynard•25m ago•0 comments

The road to epsilon-zero: Nim always ends, even with infinite ordinals

https://blog.plover.com/math/ordinals/02-wellfoundedness.html
2•pavel_lishin•31m ago•0 comments

MAGA Media Lap Up Trump's Election-Interference Exaggerations

https://www.nationalreview.com/news/maga-media-lap-up-trumps-election-interference-exaggerations/
1•petethomas•31m ago•0 comments

How to manage AI investments in the agentic era

https://openai.com/index/managing-ai-investments-in-agentic-era/
1•gmays•31m ago•0 comments

Show HN: Vidmoat – a video editing pipeline any AI agent can operate

https://www.vidmoat.com/
2•fredabila•32m ago•0 comments

Jacobian conjecture was proven for 3D, Math seems to be distraction however

https://abhishek-shankar.com/posts/the-zero-discount-claim
1•catstyler•34m ago•0 comments

Show HN: PounceDomains – Domain discovery and sniping for Namecheap Marketplace

https://pouncedomains.com
1•DotSauce•34m ago•0 comments

Linux Now Runs on the Atari Jaguar, a 1993 Console with Just 2 MB of RAM

https://linuxiac.com/linux-now-runs-on-the-atari-jaguar-a-1993-console-with-just-2-mb-of-ram/
3•cable2600•36m ago•0 comments

The road to epsilon-zero: ordinals as Nim-heaps

https://blog.plover.com/math/ordinals/01-nim.html
1•pavel_lishin•38m ago•0 comments

Why Andrew Tate Is a MAGA Superstar

https://www.thenation.com/article/society/andrew-tate-arrest-maga-connection/
2•petethomas•41m ago•1 comments

AI just disproved a major math problem. A mathematician explains

https://mashable.com/tech/anthropic-fable-5-disproves-jacobian-conjecture
1•01-_-•43m ago•1 comments

Secrets Don't Belong in Config

https://secretspec.dev/blog/secrets-dont-belong-in-config/
2•domenkozar•44m ago•0 comments

AI's most important protocol is getting a little bit easier to use

https://techcrunch.com/2026/07/20/ais-most-important-protocol-is-getting-a-little-bit-easier-to-use/
2•haritha1313•44m ago•0 comments

Bdinfo-rs – Rust cross-platform Blu-ray analyzer (GUI and CLI and WASM)

https://github.com/agentjp/bdinfo-rs
2•hyperslop•46m ago•1 comments

The $100M Mistake Making Modern Movies Look So Cheap

https://comuniq.xyz/post?t=1415
2•01-_-•47m ago•0 comments

Wp2shell: First Critical Unauthenticated WordPress Core RCE in Nearly a Decade

https://www.wordfence.com/blog/2026/07/wp2shell-aftermath-the-first-critical-unauthenticated-word...
1•computer23•49m ago•0 comments

How Google's A.I. Search Is Imperiling the Open Web

https://www.nytimes.com/2026/07/20/technology/google-ai-open-web.html
3•mikhael•52m ago•0 comments

Wax On, Weights Off: Knowledge Distillation Explained

https://jdsemrau.substack.com/p/knowledge-distillation-attacks
2•ph4rsikal•54m ago•0 comments