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/

Don't rely on instructions; use Agent Hooks to enforce guardrails

https://bitbytebit.substack.com/p/agent-hooks-deterministic-guardrails
1•recroad•26s ago•0 comments

Show HN: A C++ ALNS routing engine for LEO satellite mesh networks [video]

https://www.youtube.com/watch?v=6xXRh7PC7nI
1•ADARSHLILHARE•3m ago•0 comments

A Star's Death Throes Involves a Lot of Kicking

https://www.caltech.edu/about/news/a-stars-death-throes-involves-a-lot-of-kicking
1•gmays•6m ago•0 comments

Performance Improvements in Libffi

https://atgreen.github.io/repl-yell/posts/libffi-plan-cache/
1•atgreen•11m ago•0 comments

Town Square, the community deserves connection

https://cauenapier.com/blog/town-square-the-community-deserves-connection/
1•birdculture•13m ago•0 comments

Defending bot-detection code that runs on the attacker's own machine

https://trustsig.eu/blog/reverse-once-run-forever/
2•TrustSig•16m ago•0 comments

Is Trump-Netanyahu Rift on the Cards?

https://trump-netanyahu-rift.pagey.site/
1•freakynit•16m ago•0 comments

Crawling BitTorrent DHTs for Fun and Profit [pdf]

https://www.usenix.org/legacy/event/woot10/tech/full_papers/Wolchok.pdf
1•dgellow•17m ago•0 comments

Daily_stock_analysis: LLM-powered multi-market stock analysis system

https://github.com/ZhuLinsen/daily_stock_analysis
4•vantareed•19m ago•0 comments

Who Owns Your ATProto Identity? Hint: It's Probably Not You

https://kevinak.se/blog/who-actually-owns-your-atproto-identity-hint-its-probably-not-you
6•kevinak•20m ago•0 comments

Show HN: lpviz – Interactive linear programming visualization in the browser

https://lpviz.net/
5•klamike•21m ago•0 comments

8086 Segmented Memory was a good idea

https://owl.billpg.com/8086-segmented-memory-was-a-good-idea-almost/
3•billpg•22m ago•1 comments

Experiments in Sports Seismology for the World Cup

https://pnsn.org/blog/experiments-in-sports-seismology-for-the-world-cup
2•jmward01•23m ago•0 comments

Refloow Photo Studio – A local, offline photo editor with on-device AI

https://github.com/Refloow/Refloow-Photo-Studio
1•refloow•25m ago•0 comments

Ask HN: Part time developer reality check

1•tim_loaf-father•26m ago•0 comments

The New Cloud in the Stochastic CPU Era

https://twitter.com/yossieliaz/status/2068693960814424362
1•zozo-king•27m ago•0 comments

Kansas City's push for facial recognition on public buses sparks privacy debate

https://apnews.com/article/kansas-city-facial-recognition-ai-cameras-privacy-87847f57c94b6c2a9e22...
3•smurda•27m ago•0 comments

Online haters in the low-budget literary biz

https://statmodeling.stat.columbia.edu/2026/06/21/online-haters-in-the-low-budget-literary-biz/
1•Tomte•30m ago•0 comments

Prompt Caching: Just do it

https://kreidemann.com/blog/prompt-caching
2•kreidema•32m ago•0 comments

I'm done with LLM-through-chat-experience

https://www.thoughtfultechnologist.com/p/im-done-with-llm-through-chat-experience
2•nisabek•34m ago•0 comments

The Role of Carbon Capture and Storage in Decarbonizing U.S. Data Centers

https://pubs.acs.org/doi/10.1021/acs.energyfuels.6c01309
2•giuliomagnifico•35m ago•0 comments

AI Under Trump's Control: Can France Still Avoid Digital Dependence?

https://thenewassociationwebmasters.blogspot.com/2026/06/ai-under-american-control-can-france.html
10•laurentlof•38m ago•3 comments

Show HN: Stock analysis tool with quality scores and fundamental charting

https://intrinsiqq.com
2•FlippieFinance•40m ago•0 comments

Ask HN: Do you give AI coding agents their own GitHub account?

3•ahmd•40m ago•1 comments

Block rolls out Builderbot, a new suite of AI-native tools

https://block.xyz/inside/block-rolls-out-builderbot-a-new-suite-of-ai-native-tools-that-changes-t...
1•msolujic•41m ago•1 comments

ggplot2: Colour Scales and Legends

https://ggplot2-book.org/scales-colour.html
1•tosh•44m ago•0 comments

Real-time dreamy Cloudscapes with Volumetric Raymarching

https://blog.maximeheckel.com/posts/real-time-cloudscapes-with-volumetric-raymarching/
2•vortex_ape•45m ago•0 comments

Seems almost every possibly interesting title here is a NAG screen?

2•DivingForGold•45m ago•0 comments

Show HN: Cloak – let AI agents use your API keys without ever seeing them

https://github.com/cloakward/cloak
2•VarunMenon•48m ago•0 comments

Android developer verification: Building a safer ecosystem together

https://android-developers.googleblog.com/2026/06/android-developer-verification.html
1•ChrisArchitect•51m ago•0 comments