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/

Serbia's ruler VučIć concedes election to student-led protest

https://www.bbc.com/news/articles/cw5yn3xlprpmo
2•Betelbuddy•1m ago•0 comments

Conservative party wins first election in nearly a century in BC

https://www.reuters.com/legal/litigation/conservative-party-wins-first-election-nearly-century-br...
1•Bluestein•2m ago•0 comments

Stop resetting privacy settings to default on updates #17107

https://github.com/anthropics/claude-code/issues/17107
1•DesaiAshu•4m ago•0 comments

Show HN: Glitchrupt: Glitch your desktop when your AI agent needs your attention

https://github.com/elbee19/glitchrupt
1•impish19•4m ago•0 comments

I want my Wednesday back

https://blog.luitjes.it/posts/i-want-my-wednesday-back/
1•birdculture•4m ago•0 comments

Germany's Idle Nuclear Plants Eye New Life as AI Data Centers

https://www.bloomberg.com/news/articles/2026-10-22/germany-s-idle-nuclear-plants-eye-new-life-as-...
2•gnabgib•6m ago•1 comments

Disadvantages of Designating Mathematicians for AI Output Releases

https://terrytao.wordpress.com/2026/10/25/disadvantages-of-designating-mathematicians-for-ai-outp...
1•smilelamp•8m ago•0 comments

Reasons to keep TF state files small (2024)

https://newsletter.masterpoint.io/p/3-reasons-to-keep-tf-state-files-small
1•mooreds•10m ago•0 comments

Nvidia eyes converting old nuclear plants into AI data centers

https://www.tomshardware.com/tech-industry/data-centers/nvidia-eyes-converting-old-nuclear-plants...
2•rbanffy•15m ago•1 comments

Show HN: Visualization of Top News Stories

https://www.topaztee.com/digglabs/
1•topaztee•16m ago•0 comments

Musk says SpaceX restricted Ukraine's Starlink connection as service restored

https://www.bbc.com/news/articles/cvx28ljp8n4xo
2•cisc•17m ago•0 comments

F45 (Fedora 45) Final Is No-Go

https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/EWDOYT6TOMFY4X...
2•gnabgib•18m ago•0 comments

Intelligence vs. cost scaled by real prices

https://www.parepdf.com/lab/openrouter-price-vs-intelligence.html
1•redman25•19m ago•1 comments

Fedora 45 Hits a Second No-Go: Not Releasing Until November

https://www.phoronix.com/news/Fedora-45-Second-NO-GO
1•rbanffy•23m ago•1 comments

Europe's summer heat wave killed more han 50k people in urban areas

https://www.science.org/content/article/europe-s-summer-heat-wave-killed-more-50-000-people-urban...
3•rbanffy•24m ago•0 comments

Black October (Information Security)

https://en.wikipedia.org/wiki/Black_October_(information_security)
1•tech234a•25m ago•0 comments

Show HN: Valence – Self-hosted media browser (Jellyfin/Plex alternative)

https://www.getvalence.app/
1•MarquesCoding•29m ago•0 comments

Show HN: I built an AI agent to find customers on Telegram while I sleep

https://opensparta.com/en
2•hp2090•33m ago•0 comments

A rising tide raises all rents

https://jyn.dev/rising-tide-raises-rents/
3•iamnothere•36m ago•0 comments

Show HN: A Blender addon that makes Claude twice as efficient at using nodes

https://github.com/carson-katri/geometry-script
1•carson-katri•36m ago•1 comments

Abstraction on Abstraction on Abstraction

1•cccxccccxcccxxx•37m ago•0 comments

Odyssey series made with Grok Imagine

https://twitter.com/imagine/status/2113712964419063911
1•kklisura•37m ago•0 comments

Show HN: Jet Pilot – An open-source, native Kubernetes desktop client

https://github.com/unxsist/jet-pilot
2•unxsist•38m ago•0 comments

TryMyRepo

https://www.trymyrepo.com/
1•indigodaddy•41m ago•1 comments

What Security Teams Need to Know About Agents Using Abliterated Models

https://eve.security/blog/what-security-teams-need-to-know-about-agents-using-abliterated-models
2•mooreds•41m ago•0 comments

Pi on a Local Model

https://billdx.github.io/Pi-Qwen/
1•mooreds•42m ago•0 comments

Worried by Wordexp(3)

https://www.cipht.net/2023/11/21/worried-by-wordexp.html
1•fanf2•45m ago•1 comments

A Strongly Worded Letter: Mistakes Claude Makes with Hardware in the Loop

https://groundrun.io/blog/mistakes-claude-makes-with-hardware-in-the-loop/
1•adunk•45m ago•0 comments

China increasingly depends on copying American AI

https://economist.com/science-and-technology/2026/10/25/china-increasingly-depends-on-copying-ame...
3•andsoitis•45m ago•0 comments

Vivisection of an Active Russian-Market MAAS Platform and PyMapper Distribution [pdf]

https://papers.lisdex.sh/hermes/paper.pdf
1•carterperez-dev•47m ago•0 comments