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/

Printable Blank Calendar Generator

https://blankcal.app/?r=this-month&dp=1
1•zapeterson16•1m ago•0 comments

Google's Ambitious AI Search Changes (Biggest in 25 Years) Are Risky. Here's Why

https://www.inc.com/connor-jewiss/googles-ambitious-ai-search-changes-are-risky-heres-why/91347071
1•connorjewiss•1m ago•0 comments

Xi told Trump that Putin might 'regret' Ukraine invasion

https://www.ft.com/content/567c57b0-6346-43e6-9d14-840a793b4d1d
1•cwwc•2m ago•0 comments

Jigs, Products, and Appearances: The Vibe Coding Distribution Problem

https://trevoragilbert.com/posts/jigs-products-appearances-vibe-coding-distribution/
1•trevoragilbert•2m ago•0 comments

I created Age of Empires 2: The Conquerors

https://twitter.com/i/status/2056763353369063571
2•Michelangelo11•4m ago•0 comments

Trump's deal with government ends his tax audits

https://www.justice.gov/opa/media/1441216/dl
1•defly•5m ago•0 comments

Ask HN: How are people managing multi-node WireGuard deployments?

1•dminglv•6m ago•0 comments

Backup Photos from Google Photos: A Detailed Guide

https://blinkdisk.com/blog/backup-photos-from-google-photos
1•pauxel•7m ago•0 comments

Occupations with the Highest Divorce Rates

https://flowingdata.com/2026/05/07/divorce-and-occupation-2026/
1•gmays•7m ago•0 comments

This was Coworking Tech Week 2026

https://www.coworkingtechweek.com/blog/this-was-coworking-tech-week-2026/
1•inchevd•8m ago•0 comments

Hey Platforms: Add Take It Down to Your Transparency Reports

https://www.techdirt.com/2026/05/19/hey-platforms-add-take-it-down-to-your-transparency-reports/
1•hn_acker•9m ago•0 comments

Sōzune – a reverse proxy built on Sōzu, with Traefik-style autodiscovery

https://github.com/kemeter/sozune
2•Shine-neko•10m ago•2 comments

Concluding the Arc Experiment

https://www.ietf.org/archive/id/draft-adams-arc-experiment-conclusion-00.html
1•upofadown•11m ago•0 comments

Power prices on America's largest grid rose 76%

https://techcrunch.com/2026/05/15/power-prices-are-up-76-on-americas-biggest-grid-and-a-watchdog-...
1•logickkk1•11m ago•0 comments

Flyline: A Bash plugin to replace readline for a modern line editing experience

https://github.com/HalFrgrd/flyline/
4•hellohal•14m ago•3 comments

Purerl: Erlang back end for the PureScript compiler

https://github.com/purerl/purerl
1•tosh•15m ago•0 comments

A frightening weekend doesn't settle the license plate reader debate

https://www.statesman.com/opinion/editorials/article/license-plate-reader-debate-opinion-22264336...
1•jkestner•15m ago•0 comments

Trump Mobile is leaking customer info [video]

https://www.youtube.com/watch?v=voxXDDq58Bk
2•geerlingguy•16m ago•0 comments

Slow Mode

https://blog.val.town/slow-mode
2•yurivish•17m ago•0 comments

Show HN: Cable Detective

https://apps.apple.com/us/app/cable-detective/id6765963737?mt=12
1•franze•18m ago•0 comments

Raven Software's Jedi Academy sources, from 2013, had all the crunch rage intact

https://old.reddit.com/r/programming/comments/1thewau/raven_software_released_the_jedi_academy_so...
1•perching_aix•19m ago•1 comments

VeilGate- Deception Reverse Proxy

1•C0oki3s•21m ago•0 comments

Latest step in quest to 'de-extinct' Giant Moa? Hatching chicks from fake eggs

https://thespinoff.co.nz/science/20-05-2026/the-latest-step-in-the-quest-to-de-extinct-the-moa-ha...
1•HBcodes•23m ago•0 comments

Auto-Brewery Syndrome

https://en.wikipedia.org/wiki/Auto-brewery_syndrome
2•pulkitsh1234•23m ago•0 comments

Predicting categorical&continuous Alzheimer's disease outcomes from 1 MRI scan

https://www.nature.com/articles/s43587-026-01121-2
4•bookofjoe•23m ago•0 comments

Show HN: Enforra – open-source action governance for AI agent tool calls

https://github.com/enforra/enforra
3•rohitguptap•25m ago•1 comments

Perplexity says its AI agent cut Rho's weekly meeting time by 90%

https://twitter.com/perplexity_ai/status/2056749555346235704
1•Otek•28m ago•0 comments

Google Antigravity Built an OS from a single prompt

https://antigravity.google/blog/google-antigravity-built-an-os
3•py4•28m ago•4 comments

Gmail is going to start talking to you

https://www.theverge.com/tech/932973/google-gmail-live-ai-keep-docs-io-2026
1•cdrnsf•30m ago•2 comments

The Telescope That Got Shot (2023)

https://www.amusingplanet.com/2023/04/the-telescope-that-got-shot.html
2•NKosmatos•31m ago•0 comments