frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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/

Our 2D game character grew 3% taller every time he walked

https://hey.paris/posts/leo-sprite-alignment/
1•parisidau•43s ago•0 comments

Zero Knowledge (About) Encryption: Security Analysis of Password Managers

https://eprint.iacr.org/2026/058
1•Ember_Wipe•7m ago•0 comments

Why young academics are leaving academia

https://www.ft.com/content/8097a49b-32f9-455c-890c-921d3b419f59
1•bazzmt•9m ago•0 comments

Le Baguette Index

https://lebaguetteindex.fr/
1•wouterjanl•10m ago•0 comments

Show HN: A deep dive into Kubernetes internals

https://semicolony.dev/codex/kubernetes/
2•officerdodles12•12m ago•0 comments

What Is a Galvayne's Groove?

http://www.cowboyway.com/What/GalvaynesGroove.htm
1•thunderbong•13m ago•0 comments

Prebuilt FFmpeg ffmpeg.so and executables for Android ARM64-v8a 16kb page size

https://github.com/hzw1199/Android-FFmpeg-Prebuilt
1•hzw1199•15m ago•0 comments

Toast: Where PostgreSQL hides big values

https://boringsql.com/posts/postgresql-toast/
1•radimm•18m ago•0 comments

You're on Your Own – Not Anymore

https://zenodo.org/records/20373732
1•anasteciadunu•18m ago•0 comments

Switchberry Turns a Raspberry Pi CM4 into a Time-Focused Ethernet Switch

https://www.hackster.io/news/the-switchberry-turns-a-raspberry-pi-compute-module-4-into-a-time-fo...
3•teleforce•24m ago•0 comments

User just tricked Grok and Bankrbot to send tokens with Morse code

https://www.cryptopolitan.com/user-tricked-grok-bankrbot-to-send-tokens/
1•austinallegro•25m ago•0 comments

Flatpak Will Depend on Systemd

https://www.osnews.com/story/145071/flatpak-will-depend-on-systemd/
1•pjmlp•25m ago•0 comments

Ego-Driven Development

https://www.ivan.codes/blog/let-it-cook
1•deeshee•27m ago•0 comments

Sieve of Eratosthenes

https://dfns.dyalog.com/n_sieve.htm
1•tosh•28m ago•0 comments

Sam-3D-Body in C++: zero-Python runtime for full-body 3D pose and mesh from RGB

https://github.com/AmmarkoV/SAM3DBody-cpp
2•AmmarkoV•30m ago•0 comments

Show HN: Cordium – FOSS sandbox platform with secretless infrastructure access

https://github.com/octelium/cordium
1•geoctl•33m ago•0 comments

FreeBSD Foundation's IRS filings, the numbers are concerning

https://old.reddit.com/r/freebsd/comments/1rq0ucy/ive_been_going_through_the_freebsd_foundations/
1•sunshine-o•33m ago•0 comments

Aspire – orchestrate front ends, APIs, containers, and databases

https://aspire.dev/
1•nreece•33m ago•0 comments

Show HN: Multi-player doom on browser via Cloudflare for free

https://playdoom.ossy.dev/
1•postatic•35m ago•0 comments

Resist Less, Not Try Harder

https://personalokr.substack.com/p/resist-less-not-try-harder
1•whedrich•35m ago•1 comments

Book II-Apple II+ laptop made with period-correct chips

https://8086cpu.com/Z80/6502/110.html
1•rbanffy•36m ago•0 comments

Franchising has made Americans rich

https://economist.com/business/2026/05/24/franchising-has-quietly-made-countless-americans-rich
1•andsoitis•37m ago•0 comments

EU bringing in Digital IDs for citizens: What are they? How will it affect you?

https://www.thejournal.ie/eu-digital-id-wallet-ireland-plans-online-verification-explainer-factch...
2•austinallegro•37m ago•1 comments

I passed Claude Certified Architect: here's my notes and a practice exam

https://practice-exam-deploy.vercel.app/
2•hamzaf•42m ago•0 comments

Who Will Monetize Truth? [pdf]

https://readwise-assets.s3.amazonaws.com/media/wisereads/articles/who-will-monetize-truth/who-wil...
1•crcastle•45m ago•0 comments

96% Correct Next Token Prediction, with No DNN, No Training, Autodistilled Model

https://mltechniques.com/2026/05/25/96-correct-next-token-prediction-with-no-dnn-no-training-auto...
1•MLTechniques•46m ago•1 comments

AI Makes Adding Features Faster – So Why Not Add Just One More?

https://grith.ai/blog/just-one-more-feature?nop
2•edf13•47m ago•2 comments

Ask HN: How to get back into programming without AI?

2•coolcoder613•49m ago•6 comments

Your Token Was an Equity Grant All Along

https://artsabintsev.substack.com/p/your-token-was-an-equity-grant-all
1•Arts86•51m ago•0 comments

I built a scanner that found 41 live AWS keys in 900 Terraform state files

https://vechron.com/2026/05/i-found-900-s3-buckets-exposing-terraform-state-files-41-had-live-aws...
10•GeorgeWoff25•52m ago•0 comments