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/

Visidata: A terminal spreadsheet multitool for discovering and arranging data

https://github.com/saulpw/visidata
1•tosh•41s ago•0 comments

UK PM tells Apple and Google to ban nude images on children's phones

https://www.bbc.co.uk/news/articles/cly752ydjw6o
1•xenocratus•1m ago•0 comments

xcesp: Developing for ESP32 Devices with Xcode

https://kohlschuetter.github.io/blog/posts/2026/06/08/xcode-esp/
1•kohlschuetter•1m ago•0 comments

How to Get Out of a Funk

https://sublimeinternet.substack.com/p/how-to-use-sublime-to-get-out-of
1•surprisetalk•2m ago•0 comments

Show HN: RepoSignal scores GitHub repos for adoption risk. No AI, no servers

https://github.com/udit-rawat/RepoSignal
1•udit-r•3m ago•0 comments

The purist's model of spaced repetition

https://www.natemeyvis.com/the-purists-model-of-spaced-repetition/
1•ingve•4m ago•0 comments

Anti-social: It's fads, not friends, which now dominate social media feeds

https://www.bbc.com/worklife/article/20260520-how-social-media-ceased-to-be-social
3•1vuio0pswjnm7•4m ago•0 comments

Skills Are Rotting Inventory

https://blog.danielvaughan.com/skills-are-inventory-0ad323081324
1•dvaughan•8m ago•0 comments

XWiki and OpenProject as an open-source alternative to Confluence and Jira

https://xwiki.com/en/webinars/Open-Project-XWiki-June-2026
2•lorinab•8m ago•2 comments

SpaceX ($SPCX): AI, Chips, Sats, Launches and Orbital Compute Under One Roof

https://twitter.com/StockAnalystPro/status/2063675760725160211
1•bilsbie•9m ago•0 comments

Caddy Defender Plugin: return garbage responses for AI crawlers

https://github.com/jasonlovesdoggo/caddy-defender
2•hamburgererror•10m ago•0 comments

Japanese city shuts down nearly 100 schools after unprecedented bear sighting

https://www.theguardian.com/world/2026/jun/08/utsunomiya-city-japan-bear-sighting-all-primary-sec...
2•bookofjoe•10m ago•0 comments

Majority of US's new AI datacenters to be built on drought-hit land

https://www.aol.com/news/majority-us-ai-datacenters-built-110023869.html
2•1vuio0pswjnm7•10m ago•0 comments

Apple's Meeting That Led It to Take AI Seriously

https://www.bloomberg.com/news/newsletters/2026-06-07/wwdc-2026-apple-s-secret-meeting-that-led-i...
1•shortlived•10m ago•1 comments

Cholesky Decomposition

https://en.wikipedia.org/wiki/Cholesky_decomposition
1•tosh•11m ago•0 comments

The Next Big Leap

https://arkvis.com/blog/2026-06-05_the-next-big-leap.html
1•phyzix5761•13m ago•0 comments

Prediction markets are fueling a new era of political graft

https://www.fastcompany.com/91554204/prediction-markets-kalshi-polymarket-political-graft
2•1vuio0pswjnm7•13m ago•0 comments

Show HN: I revived Scoragora, a World Cup prediction game

https://scoragora.com/
1•joyinsky•13m ago•0 comments

Show HN: The App with No Back End – How I Built a Premium E-Reader for $0/Month

https://conceptz.medium.com/the-app-with-no-backend-how-i-built-a-premium-e-reader-for-0-month-fa...
1•dfe001•14m ago•1 comments

Pick and Place: Carbon Nanotube Nanoassembly Process

https://www.c12qe.com/news/pick-and-place-carbon-nanotube-quantum-chip-manufacturing
1•bpierre•14m ago•0 comments

AI revives lean-forward UX

https://jakobnielsenphd.substack.com/p/ux-roundup-20260608
1•andsoitis•17m ago•0 comments

Thoughts Ahead of WWDC 2026

https://anderegg.ca/2026/06/07/thoughts-ahead-of-wwdc-2026
2•GavinAnderegg•21m ago•0 comments

Show HN: Vui – open-source voice mode

https://twitter.com/harrycblum/status/2062308968228147254
1•bazlan•22m ago•0 comments

Cheap to Write, Expensive to Own

https://mijndertstuij.nl/posts/cheap-to-write-expensive-to-own/
2•theanonymousone•23m ago•0 comments

When did we decide lines of code was a measure of productivity?

https://medium.com/@mooseyanon/when-did-we-decide-lines-of-code-was-a-measure-of-productivity-e14...
1•arm93•25m ago•0 comments

Productivity Effects Across Generations of AI Coding Tools [pdf]

https://www.nber.org/system/files/working_papers/w35275/w35275.pdf
1•robin_reala•25m ago•0 comments

A Case for Simulation-Driven Resilience in Agentic Data Systems

http://muratbuffalo.blogspot.com/2026/06/a-case-for-simulation-driven-resilience.html
1•eigenBasis•28m ago•0 comments

Show HN: AI agents shouldn't just be for developers

1•cheikhshift•30m ago•0 comments

WOS: a Rust ARM64 kernel from scratch with MMU and GICv2 working

https://github.com/jietra/wos
1•ulrichxtan•30m ago•1 comments

Chinese court cases reveal most trafficked rhino horns come from Southern Africa

https://news.mongabay.com/2026/04/chinese-court-cases-reveal-most-trafficked-rhino-horns-come-fro...
2•PaulHoule•30m ago•0 comments