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/

The Mysterious Woman Behind the Nord Stream Explosion

https://www.wsj.com/world/europe/nord-stream-explosion-pipeline-9a109da9
1•nradov•4m ago•0 comments

Glacial Valley

https://github.com/deedy/glacial-valley
1•tanelpoder•4m ago•0 comments

Linear Algebra Kernels for the Age of Research

https://www.gpumode.com/news/linear-algebra-kernels-age-of-research
1•matt_d•8m ago•0 comments

Russia builds up infrastructure near Europe's border to deploy over 100k troops

https://www.pravda.com.ua/eng/news/2026/06/10/8038671/
1•Bender•10m ago•0 comments

From a Single File to an MCP Server: Six Rewrites of My Own Harness

https://pub.towardsai.net/from-a-single-file-to-an-mcp-server-six-rewrites-of-my-own-harness-74b4...
2•tacoda•12m ago•0 comments

Agentifying Agent Assessment for Openness, Standardization, and Reproducibility

https://arxiv.org/abs/2606.13608
1•tcp_handshaker•17m ago•0 comments

Pink Cosmo Blueberries

https://www.baldorfood.com/product/blueberries/be3p-pink-cosmo-blueberries
1•mooreds•19m ago•0 comments

Why Tomatoes Are the Most Expensive They've Been in Four Decades [audio] [video]

https://www.youtube.com/watch?v=pUrIlUAo0kM
1•mooreds•19m ago•0 comments

What Do Engineers Mean When We Say "Taste"?

https://davegriffith.substack.com/p/what-do-engineers-mean-when-we-say
1•mikez302•20m ago•0 comments

Latent learning: episodic memory complements parametric learning

https://openreview.net/forum?id=RuWGeX5ZiB
1•matt_d•21m ago•0 comments

Erdős Problems and Speculations about the Power of AI Models

https://www.youtube.com/watch?v=KbNctTQnVHI
1•maayank•24m ago•0 comments

Show HN: Agent Joe – a Rust only coding agent with no shell access

https://github.com/Kapperchino/agent-joe
1•kapperchino•24m ago•0 comments

I Think They [Anthropic] Are Lying to You [video]

https://www.youtube.com/watch?v=zfYsSFY4l18
5•salutis•25m ago•1 comments

Digg

https://digg.com/tech
2•ahmedfromtunis•26m ago•1 comments

I created a facet search over music composition (no AI)

https://monictheory.com
1•midi_finder•26m ago•1 comments

Ring Holders Club – NBA draft-and-SIM playoff run, plus a daily tactics puzzle

https://www.ringholders.club/
3•pipnonsense•26m ago•0 comments

Stackit – European Hyperscaler and Cloud Provider

https://stackit.com/en
1•tomrod•27m ago•0 comments

For People with Misophonia, Everyday Noises Can Be Agony

https://www.newyorker.com/magazine/2026/06/15/for-people-with-misophonia-everyday-noises-can-be-a...
1•fortran77•28m ago•0 comments

'Crisis averted' as experts confirm universe's expansion is accelerating

https://ras.ac.uk/news-and-press/research-highlights/crisis-averted-experts-confirm-universes-exp...
2•hhs•29m ago•0 comments

Espressif Modules

https://esp32.atomic14.com/modules/
1•iamflimflam1•30m ago•0 comments

N8ao – An efficient and visually pleasing implementation of SSAO

https://github.com/N8python/n8ao
1•modinfo•32m ago•0 comments

The World Computer Has Children

https://hari.computer/the-world-computer-has-children
1•andytratt•38m ago•0 comments

Astrology Is Scientifically Provable

https://astrologerapp.org/free-synastry
1•calamaridude•38m ago•3 comments

Cooling at the Speed of Light

https://cacm.acm.org/news/cooling-at-the-speed-of-light/
2•sohkamyung•39m ago•0 comments

Google's new remote attestation scheme is as terrible as old scheme

https://pluralistic.net/2026/06/12/compelled-speech/
3•healsdata•39m ago•0 comments

Jane Yolen (1939–2026)

https://locusmag.com/2026/06/jane-yolen-1939-2026/
2•sohkamyung•39m ago•0 comments

Ask HN: How are you designing human review for production AI agents?

2•willXare•40m ago•1 comments

Scientists decipher how the nucleus gets its energy

https://heart.arizona.edu/news/power-genome-scientists-decipher-how-nucleus-gets-its-energy
2•hhs•40m ago•0 comments

AMD Stiffs Researcher $10k Bug Bounty

https://www.gadgetreview.com/amd-stiffs-researcher-10000-bug-bounty-after-critical-security-flaw-...
7•worik•41m ago•0 comments

Putin expands military presence on NATO's border

https://www.telegraph.co.uk/world-news/2026/06/11/pictured-putin-expands-military-presence-on-nat...
5•Bender•41m ago•1 comments