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/

xPrize Launches Hackathon with $2M Prize Pool, Backed by Google

https://www.xprize.org/news/xprize-launches-hackathon-with-2-million-prize-pool-backed-by-google
1•T-A•11m ago•0 comments

Stanford scientists just built a room-temperature quantum device

https://maketecheasier.com/stanford-scientists-just-built-a-room-temperature-quantum-device-that-...
1•SVI•13m ago•1 comments

An Excruciatingly Detailed Guide to SSH

https://grahamhelton.com/blog/ssh-cheatsheet
3•thunderbong•19m ago•0 comments

Virtual Railfan

https://virtualrailfan.com:443/
1•tkgally•22m ago•0 comments

Expanding the lifespan of solid-state batteries

https://www.mpg.de/26391218/how-dendrites-shorten-the-lifespan-of-solid-state-batteries
1•croes•24m ago•0 comments

LLM Paper Trading

https://gertlabs.com/spectate?game=trading
5•gertlabs•25m ago•4 comments

Explosives Synthesis, Ricin Production and Anatomical Neutralization Protocols

https://vostoktechnicalbureau.substack.com/p/red-team-technical-dossier-operational
1•VostocBuraeu•26m ago•0 comments

Just Send Me the Prompt

https://blog.gpkb.org/posts/just-send-me-the-prompt/
1•globular-toast•37m ago•0 comments

Botnet of more than 17M devices dismantled

https://arstechnica.com/security/2026/05/botnet-of-more-than-17-million-devices-dismantled/
2•joozio•41m ago•0 comments

Macsurf, "modern" web browser for macOS 9

https://github.com/mplsllc/macsurf
1•gattilorenz•45m ago•0 comments

Show HN: Totpgate – Single-packet authorization via TOTP

https://github.com/PepperDev/totpgate
1•tpimenta•54m ago•0 comments

Lisa Su Address to MIT Class of 2026 [video]

https://www.youtube.com/watch?v=vQMQjHv5pEM
3•vinhnx•55m ago•0 comments

NPM Packages Attacks

1•carlostkd•1h ago•0 comments

Let's talk about encrypted reasoning

https://blog.cryptographyengineering.com/2026/05/29/fooling-around-with-encrypted-reasoning-blobs/
2•MrBuddyCasino•1h ago•0 comments

WikiLambda the Ultimate

https://en.wikipedia.org/wiki/Wikipedia:Wikipedia_Signpost/2026-05-22/Recent_research
1•Antibabelic•1h ago•0 comments

Paint .NET is now at paint.net

https://bsky.app/profile/rickbrew.bsky.social/post/3mmz73u6lzs2t
5•Tomte•1h ago•0 comments

Anatomy of a 5-4 Champions League Thriller: A Football Data Case Study

https://beetl.io/blog/anatomy-of-a-5-4-champions-league-thriller/
1•inchevd•1h ago•0 comments

Sandboxed dev envs that are composable and repeatable with a single command

https://ubuntu.com/workshop
2•himanshu810e•1h ago•1 comments

Acer's launching a Linux handheld for streaming your PC games

https://www.theverge.com/games/940091/acer-nitro-blaze-link-linux-handheld
2•teleforce•1h ago•0 comments

A Brief, Incomplete, and Mostly Wrong History of Programming Languages (2009)

http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html
2•azhenley•1h ago•0 comments

Company Blew $500M on Claude AI in One Month Due to No Usage Limit on Licenses

https://www.gadgetreview.com/company-blew-500m-on-claude-ai-in-one-month
2•dotcoma•1h ago•1 comments

Nvidia says it has largely conceded China's AI chip market to Huawei

https://www.cnbc.com/2026/05/21/nvidia-jensen-huang-china-ai-chip-market-huawei.html
2•KnuthIsGod•1h ago•0 comments

Show HN: Clinglang – A shorthand language for doctors to write structured cases

https://github.com/ppnpm/clinlang
1•ppnpm•1h ago•0 comments

OpenRCT2 v0.5.1 "Swamp Castle" released Last version to support Windows 7

https://openrct2.io/blog/2026/05/openrct2-v0.5.1-released
3•jandeboevrie•1h ago•0 comments

Guitar Tools – PWA for Scales, Circle of Fifths and More

https://guitar-tools.eejalab.xyz/
4•hannofcart•1h ago•3 comments

Sleuths uncover 100 suspicious images in Thermo Fisher antibody catalogue

https://www.nature.com/articles/d41586-026-01706-2
3•Teever•1h ago•0 comments

Cathy Tie's mission to genetically modify babies

https://www.theguardian.com/science/2026/may/30/there-is-no-way-to-stop-this-biotech-barbie-cathy...
1•skruger•1h ago•0 comments

Boom shakes S Carolina, rattling Columbia and raising questions about the cause

https://www.thestate.com/news/local/environment/article315932620.html
3•thunderbong•2h ago•0 comments

Show HN: I built an Android OS in the browser

https://mobilegym.dev/
3•haozaz•2h ago•0 comments

A Weekend in Claude Design Saves 3 Weeks of Claude Code

https://cashandcache.substack.com/p/the-prototype-tax-how-a-weekend-in
2•binyu•2h ago•0 comments