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/

Power of Raycast, Now on iOS

https://www.raycast.com/ios
1•rene_d•2m ago•0 comments

Punchy – a security Tamagotchi that boxes the internet

https://punchy.virtualserv.uk
1•raister•11m ago•0 comments

What if your ChatGPT conversations have a dashboard that can track things

https://chatgpt.com/plugins/plugin_asdk_app_6ad58e43cfe881919841205d69cff9cf
1•vasanthps•12m ago•0 comments

Good writing is a business advantage (2020)

http://adaged.blogspot.com/2020/04/good-writing-is-business-advantage.html
1•zenincognito•21m ago•0 comments

Non-autoregressive NC LLM spits tokens 21x faster than text diffusion

https://hazyresearch.stanford.edu/blog/2026-10-12-ncm
1•LarsDu88•21m ago•0 comments

Junglia theme park in Okinawa posted ¥17.3B (US$109.84) loss in first year

https://www.japantimes.co.jp/business/2026/09/26/junglia-okinawa-first-year-loss/
1•guessmyname•25m ago•0 comments

Farewell – ETAOIN SHRDLU – 1978 [video]

https://vimeo.com/127605643
1•apical_dendrite•25m ago•0 comments

Ask HN: Is the Microsoft buyout just a long overdue correction?

2•sky2224•30m ago•1 comments

Push Ifs Up and Fors Down

https://matklad.github.io/2023/11/15/push-ifs-up-and-fors-down.html
2•dboon•30m ago•0 comments

From the Analytics Department to a Lone Operator with a Laptop

https://medium.com/@smoking2man/from-the-analytics-department-to-a-lone-operator-with-a-laptop-ho...
1•Aldus551•31m ago•0 comments

Digital Minimalism

https://vitalik.eth.limo/general/2026/10/31/digital_minimalism.html
3•wilbertliu•36m ago•0 comments

Mexico urges respect for treaties after Texas seizes nine islands on Rio Grande

https://english.elpais.com/usa/2026-10-30/mexico-urges-respect-for-treaties-after-texas-seizes-ni...
1•geox•37m ago•0 comments

Ask HN: Is anyone else struggling with AI wealth FOMO?

2•kadhirvelm•38m ago•1 comments

Automated Subtle Emergent Misalignment Research

https://alignment.anthropic.com/2026/automated-em-search/
1•pretext•41m ago•0 comments

UTF-34 BASE-4: Codespace 4^34 = 2^68, Zero-Waste Theorem, and 1M Binary Codes

https://media.githubusercontent.com/media/anhkhoavanhua/utf34/refs/heads/main/utf34_base4_1M_bina...
1•jackhua18112001•43m ago•0 comments

Cold showers benefit the environment and your health

https://www.unibas.ch/en/News-Events/News/Uni-Research/cold-showers-health-environment.html
4•DeepLogin•44m ago•1 comments

Tier 1 ISPs react to unfair pricing

https://www.datacenterknowledge.com/networking/cogent-unplugs-telia-in-peering-dispute
1•countWSS•46m ago•1 comments

Google Adopts New AI Training Control

https://www.seroundtable.com/google-ai-training-control-42430.html
1•thm•51m ago•1 comments

Spanish minister refuses to resign over second major train crash on his watch

https://www.channelnewsasia.com/world/spain-transport-minister-resign-train-crash-6507826
2•Markoff•58m ago•1 comments

Language Models Need Sleep: Learning to Self-Modify and Consolidate Memories

https://arxiv.org/abs/2606.03979
4•olalonde•59m ago•0 comments

Tell HN: Claude is using my limits even though it's infra is failing

2•throwaw12•1h ago•4 comments

How hard is it to check for whitespace?

https://serce.me/posts/2026-10-30-how-hard-is-it-to-check-for-whitespace
2•SerCe•1h ago•0 comments

Alkaline batteries are obsolete – but not for the reason you'd think [video]

https://www.youtube.com/watch?v=I1rlK3BKmyA
3•no-name-here•1h ago•0 comments

Show HN: Archwhere – work alongside AI coding agents on an architecture map

https://github.com/tapaskar/archwhere
1•sparkupcloud•1h ago•0 comments

Cloudflare Build

https://build.cloudflare.dev
2•tomrod•1h ago•1 comments

Apple Is Entering Its Slop Era

https://www.404media.co/apple-is-entering-its-slop-era/
1•Garbage•1h ago•0 comments

Cursed cruise: how the dream of never-ending luxury at sea became a nightmare

https://www.theguardian.com/news/ng-interactive/2026/oct/31/mv-odyssey-cruise-passengers-nightmar...
6•mellosouls•1h ago•1 comments

Show HN: Ramekin – IoT development, deployment and update platform via Apptainer

https://github.com/ascension-association/ramekin
1•mrbluecoat•1h ago•0 comments

Show HN: ViBrow – A custom browser engine in pure Python for Raspberry Pi Zero

https://github.com/HYXZKAKONHNK/ViBrow
1•pfehqqq•1h ago•0 comments

The Beleaguered Chip Sellers Getting Their Revenge on Apple

https://www.wsj.com/tech/apple-iphone-memory-chips-ai-c0084cc9
3•shubhamjain•1h ago•0 comments