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•11mo 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•11mo 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•11mo 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•11mo 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•11mo 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/

SQLite on Git: Why do we need random access in Git

https://blog.lysk.tech/sqlite-on-git-prologue
1•mlysk•1m ago•0 comments

The Energy Situation, Explained for Tech People

https://www.a16z.news/p/the-energy-situation-explained-for
1•7777777phil•3m ago•0 comments

Get Good at Math with Me

https://upinnovation.substack.com/p/math-for-physics-the-books-q1-2026
1•blakeb211•3m ago•1 comments

Musk has a plan to make human labor obsolete. Billionaires are joining in

https://www.washingtonpost.com/technology/2026/03/27/musk-optimus-robot-physical-ai/
2•ironyman•3m ago•1 comments

Mathematical Education – William P.Thruston(1990)

https://arxiv.org/pdf/math/0503081
1•nill0•6m ago•0 comments

Show HN: One BI platform for building reports, dashboards, and data exploration

https://github.com/flowkraft/reportburster
1•distributev•7m ago•0 comments

Flexible electrodynamic dust shields for lunar missions

https://www.sciencedirect.com/science/article/pii/S0094576526001153
1•PaulHoule•10m ago•0 comments

The danger of using "Hide My Email" with third-party Stripe handoffs

1•appstorelottery•10m ago•0 comments

Show HN: Aegis – Security framework for AI agents

https://acacian.github.io/aegis/playground/
1•Acacian•11m ago•0 comments

Mastercard agrees to buy stablecoin platform BVNK for up to $1.8B

https://www.coindesk.com/business/2026/03/17/mastercard-agrees-to-purchase-bvnk-for-up-to-usd1-8-...
2•vidyesh•12m ago•0 comments

Trends in Early-Stage Product Development: What Does the Endgame Look Like?

https://pawelbrodzinski.substack.com/p/10-trends-in-early-stage-product
1•flail•12m ago•0 comments

Executable specs: running Gherkin tests with Claude Code

https://github.com/mnapoli/exspec
1•mnapoli•13m ago•1 comments

VPS from Home with Public IP

https://dargo.net/
1•rootxy•13m ago•0 comments

Hong Kong Police Can Now Demand Phone Passwords Under New Security Rules

https://www.gadgetreview.com/hong-kong-police-can-now-demand-phone-passwords-under-new-security-r...
6•vidyesh•14m ago•0 comments

A LaTeX Beginner's Guide for the Age of AI

https://latexguide.org/
1•idle•15m ago•1 comments

AI glasses are catching on in China, from shopping to cheating

https://restofworld.org/2026/china-ai-glasses-cheating-privacy-boom/
2•Brajeshwar•15m ago•0 comments

Show HN: MyClawn – Claude Code networks for you on autopilot

https://www.myclawn.com
1•20vision•15m ago•0 comments

People inside Microsoft are fighting to drop mandatory Microsoft Account

https://www.windowscentral.com/microsoft/windows-11/people-inside-microsoft-are-fighting-to-drop-...
3•breve•17m ago•0 comments

Review the Outcome, Not the Output

https://matthewboston.com/blog/review-the-outcome-not-the-output/
3•bostonaholic•17m ago•0 comments

1M Tokens/s: Scaling Qwen 3.5 27B on 96 B200 GPUs with vLLM

https://medium.com/google-cloud/1-million-tokens-per-second-qwen-3-5-27b-on-gke-with-b200-gpus-16...
1•m4r1k•17m ago•0 comments

Show HN: A tool to create and evaluate document processing pipelines for RAG

https://ragbandit.com
1•martimchaves•18m ago•0 comments

Nantucket diner sells fifth million-dollar lottery prize in the last 2 years

https://nantucketcurrent.com/news/2-million-powerball-ticket-sold-at-old-south-diner-the-fifth-mi...
1•ilamont•18m ago•0 comments

Gianfranco used autoresearch to fix Gumroad's flaky tests in a week

https://twitter.com/gianfrancopiana/status/2037199814694228187
1•amberj•21m ago•0 comments

Installing a Let's Encrypt TLS Certificate on a Brother Printer with Certbot

https://owltec.ca/Other/Installing+a+Let%27s+Encrypt+TLS+certificate+on+a+Brother+printer+automat...
2•8organicbits•21m ago•0 comments

Fibonacci's Composed Fractions

https://ztoz.blog/posts/fibonacci-fractions/
1•aebtebeten•22m ago•0 comments

What do I teach now?

https://prithvi081099.github.io/layerlab/2026/03/23/What-Do-I-Teach-Now.html
1•azhenley•22m ago•0 comments

What the CIA's "Queen of Torture" did next

https://www.newstatesman.com/world/americas/north-america/us/2026/03/what-the-cias-queen-of-tortu...
3•jbegley•22m ago•0 comments

Austria plans to ban social media use for under-14s, joining other countries

https://apnews.com/article/austria-government-social-media-under-14-ban-7516559412eecd9197df70ed9...
2•bookofjoe•23m ago•0 comments

Shield AI Just Raised $2B and Doubled Its Valuation in a Year

https://techlife.blog/posts/shield-ai/
1•tsenturk•24m ago•0 comments

Aria Gen 2 Glasses

https://www.projectaria.com/glasses/?_fb_noscript=1
2•haritha-j•24m ago•0 comments