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/

Walking Men from Around the World

https://mossandfog.com/walking-men-from-around-the-world/
1•gaws•1m ago•0 comments

Sycophantic Chatbots Cause Delusional Spiraling, Even in Ideal Bayesians

https://arxiv.org/abs/2602.19141
1•luispa•2m ago•0 comments

After Jenny Simpson&Jeff Browning, What Runners Should Know About Cardiac Events

https://www.trailrunnermag.com/training/after-jenny-simpson-and-jeff-browning-heres-what-runners-...
1•bookofjoe•5m ago•0 comments

Hegseth Announces AutoWarCom

https://www.militarytimes.com/news/your-military/2026/09/30/hegseth-announces-new-four-star-comma...
4•nick__m•6m ago•1 comments

Show HN: DragomanD – local language translator for Linux

https://dragomand.l10n-bg.dev/
1•eniac111•6m ago•0 comments

Expanding My Music Pipeline

https://www.coryd.dev/posts/2026/expanding-my-music-pipeline
1•nullpad•7m ago•0 comments

Show HN: Certify you wrote it and not AI

https://iwrote.co
1•arpanghoshal•9m ago•0 comments

YouTube lunatic designed and 3D printed a working mechanical calculator

https://www.theregister.com/offbeat/2026/09/30/youtube-lunatic-designed-and-3d-printed-a-working-...
2•joebuckwilliams•10m ago•0 comments

Swatting Calls: A Couple's Fight Against Online Stalkers and the Police

https://www.nytimes.com/2026/09/30/us/swatting-milwaukee-couple-settlement.html
2•nonfamous•10m ago•0 comments

Watch the Rogue AI Committee Hearing

https://www.hsgac.senate.gov/subcommittees/dmdcc/hearings/rogue-ai-securing-the-homeland-against-...
1•sans_souse•11m ago•0 comments

How to Select an Experiment: More on experiment metastrategy

https://chillphysicsenjoyer.substack.com/p/how-to-select-an-experiment
1•crescit_eundo•16m ago•0 comments

Elon Musk, Palmer Luckey, Newt Gingrich to Help Pentagon with Warfare Initiative

https://www.cnbc.com/2026/09/30/musk-luckey-gingrich-pentagon-hegseth-.html
6•Teever•17m ago•0 comments

pldb: programming languages papers

https://pldb.kirancodes.me/
3•matt_d•19m ago•0 comments

Show HN: Real-time raytracing around a black hole

https://rivendell.dmitrybrant.com/blackhole/
1•dmitrybrant•19m ago•0 comments

Qc: Video quality check and h264/HEVC/av1 ladder optimization

https://github.com/eko/qc
2•eko•24m ago•0 comments

Vast-10M

https://www.voltropy.com/blog/vast-10m/
1•amirhirsch•25m ago•0 comments

Origin: Computer Science Not About Computers, Astronomy Not About Telescopes

https://quoteinvestigator.com/2021/04/02/computer-science/
2•pcfwik•25m ago•0 comments

Codex Pricing: Pro has unlimited 5.6 usage

https://chatgpt.com/codex/pricing/
11•rene_d•29m ago•6 comments

DepthFirst: Continuous Cyber Defense

https://depthfirst.com/
1•handfuloflight•29m ago•0 comments

The $170B lesson data center developers keep learning the hard way

https://www.fastcompany.com/91612143/ai-data-centers-local-communities
1•johnshades•29m ago•0 comments

16-year-old found Microsoft bug, got admin access to 17.3T-row databases

https://www.theregister.com/security/2026/09/30/16-year-old-researcher-found-a-microsoft-bug-got-...
5•johnshades•31m ago•0 comments

Gloriously project runs transformer model written in PDP-11 assembly [video]

https://www.youtube.com/watch?v=OUE3FSIk46g
1•madradavid•33m ago•0 comments

Strata: Run a 125B-parameter AI model on a normal gaming PC

https://github.com/Niko1221/Strata
2•maille•35m ago•0 comments

Hackers stole US Military records during months-long data breach

https://techcrunch.com/2026/09/30/hackers-stole-millions-of-us-military-personnel-records-during-...
4•DamnInteresting•37m ago•0 comments

There Are Plenty of Laws on the Books to Check the A.I. Giants. Use Them

https://www.nytimes.com/2026/09/30/opinion/ai-anthropic-amodei-self-regulation.html
5•SLHamlet•37m ago•0 comments

Host Your First Profitable Meetup or Mini-Conference

https://outlier-media-co.ever795522.chatgpt.site/ebook/
1•EverGonzalez76•39m ago•0 comments

Tell HN: Thanks for All the Fish

3•neilv•40m ago•0 comments

It may soon be possible to create "mirror life"

https://www.economist.com/science-and-technology/2026/09/30/it-may-soon-be-possible-to-create-mir...
3•vinni2•40m ago•0 comments

Decoupled DiLoCo for Resilient Distributed Pre-Training

https://arxiv.org/abs/2604.21428
1•lawrenceyan•43m ago•0 comments

Invisible XML (2025)

https://www.xml.com/articles/2025/12/02/invisible-xml-update/
5•devonnull•43m ago•0 comments