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/

Malware crew TeamPCP open-sources its Shai-Hulud worm on GitHub

https://www.theregister.com/security/2026/05/13/malware-crew-teampcp-open-sources-its-shai-hulud-...
1•birdculture•36s ago•0 comments

Using LLMs to find Python C-extension bugs

https://lwn.net/Articles/1067234/
1•PaulHoule•3m ago•0 comments

Gunshots fired in standoff at Philippine Senate over ICC suspect

https://www.reuters.com/world/asia-pacific/philippine-senator-says-arrest-is-imminent-urges-publi...
2•JumpCrisscross•3m ago•0 comments

Neanderthals used stone drills to treat cavities 59k years ago, tooth suggests

https://www.theguardian.com/science/2026/may/13/neanderthals-stone-drills-treat-cavities-tooth-si...
1•bookofjoe•4m ago•0 comments

Mandala: A low latency logistics event bridge for Samsara fleets

https://github.com/theoddden/Mandala
1•Facingsouth•4m ago•1 comments

Global Ammonia Infrastructure

https://ammoniaobservatory.com/infrastructure
2•leonidasrup•5m ago•0 comments

Anthropic tests Jupiter-v1-p ahead of its developer conference

https://www.testingcatalog.com/anthropic-tests-jupiter-v1-p-before-potential-launch-on-may-6/
1•gmays•5m ago•0 comments

'Pioneering' message that changed the world

https://www.bbc.co.uk/news/articles/cp84d5pl39zo
1•austinallegro•6m ago•0 comments

Neanderthals Performed Root Canals

https://www.wsj.com/science/archaeology/neanderthals-tooth-root-canal-dentist-study-dfa8a037
1•JumpCrisscross•7m ago•0 comments

CC-Ledger: anatomy of your Claude Code spend

https://ccledger.dev
1•tejpal-diffuse•9m ago•0 comments

How to Build Safe AI (Without Making the AI Safe)

https://whattotelltherobot.com/p/how-to-build-safe-ai-without-making
1•stefie10•9m ago•0 comments

AI as Social Technology

https://knightcolumbia.org/content/ai-as-social-technology
1•beepbooptheory•10m ago•1 comments

System2 – Multi-Agents for Data

https://github.com/diegoscarabelli/system2
2•diegoscara•11m ago•1 comments

Holos runs a complete ActivityPub server directly on your smartphone

https://holos.social/how-it-works
2•ZacnyLos•11m ago•0 comments

State media control influences large language models

https://www.nature.com/articles/s41586-026-10506-7
1•Timofeibu•12m ago•0 comments

China's NEV penetration hits historic 61.4% in April as ICE sales collapse

https://carnewschina.com/2026/05/13/chinas-nev-penetration-hits-historic-61-4-in-april-as-ice-sal...
4•martinpw•12m ago•0 comments

New Claude Code programmatic usage restrictions

https://twitter.com/i/status/2054610152817619388
3•martinald•12m ago•0 comments

Ask HN: Is Anthropic doing too much vibe coding?

1•terabytest•12m ago•0 comments

3D Gaussian Splatting in a Weekend

https://bfeldman.me/3dgs-weekend/
2•b__feldman•12m ago•0 comments

Claude Code weekly limits increasing 50% till July 13

https://twitter.com/ClaudeDevs/status/2054639777685934564
2•mesmertech•13m ago•3 comments

Points are an inconsistent unit of measurement

https://buttondown.com/hillelwayne/archive/points-are-a-weird-and-inconsistent-unit-of/
1•MillironX•13m ago•0 comments

Show HN: Brutal Audit, brutally honest AI site audit

https://brutalaudit.com
1•smakosh•14m ago•0 comments

Googlebook

https://en.wikipedia.org/wiki/Googlebook
1•wsgeorge•14m ago•0 comments

Why Some People Are Allergic to 'Peanut Butter Raises'

https://www.nytimes.com/2026/05/10/business/peanut-butter-raises.html
1•paulpauper•14m ago•0 comments

Data Centers and Local Economies in the Age of AI: A Shift–Share Approach

https://www.nber.org/papers/w35194
1•paulpauper•15m ago•0 comments

New way to use CLIs from your phone

https://apps.apple.com/us/app/mobilecli/id6757689455
1•AlexanderKnigge•16m ago•1 comments

Some non-obvious why AI will create transitional problems in employment

https://marginalrevolution.com/marginalrevolution/2026/05/some-non-obvious-reasons-why-ai-will-cr...
1•paulpauper•16m ago•0 comments

Overworked AI Agents Turn Marxist, Researchers Find

https://www.wired.com/story/overworked-ai-agents-turn-marxist-study/
1•littlexsparkee•19m ago•1 comments

CVE-2026-42945 – Critical heap buffer overflow in Nginx ngx_HTTP_rewrite_module

https://github.com/DepthFirstDisclosures/Nginx-Rift
1•882542F3884314B•22m ago•0 comments

OpenAI Flips the Script

https://every.to/context-window/openai-flips-the-script
1•gmays•23m ago•0 comments