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/

Jellyfin founder Andrew leaves team

https://forum.jellyfin.org/t-project-leadership-changes
2•swat535•1m ago•0 comments

Is Open Weight AI Decelerationist?

https://fragileequilibrium.substack.com/p/is-open-weight-ai-decelerationist
1•brandoncarl•2m ago•0 comments

BI 303470 a GLP-1/GIP/NPY2 triple agonist in Phase 2 What the heck is an NPY2?

https://xcancel.com/i/article/2079304056548495593
1•hnburnsy•3m ago•0 comments

Internet Freedom is Here: FreeSocks v2

https://unredacted.org/blog/2026/07/internet-freedom-is-here-freesocks-v2/
1•lunarthegrey•5m ago•0 comments

The Crowley-Atlantic Cadence and Celebrity Success

https://drive.google.com/file/d/1A2rk86a3AX62WejHwDb1I-mk7k467N8d/view
1•nvader•7m ago•0 comments

Vibe-coded a simplistic multiplayer game

https://eldermyr-production.up.railway.app/
1•josiahturnq•7m ago•1 comments

AI consciousness is a red herring in the safety debate

https://www.theguardian.com/technology/2026/jan/06/ai-consciousness-is-a-red-herring-in-the-safet...
2•teleforce•8m ago•0 comments

Cursor, Codex, Gemini CLI, Antigravity hit by sandbox escapes

https://www.bleepingcomputer.com/news/security/cursor-codex-gemini-cli-antigravity-hit-by-sandbox...
1•sbulaev•9m ago•0 comments

The biggest schools training America's doctors are in the Caribbean

https://www.economist.com/the-americas/2026/07/16/the-biggest-schools-training-americas-doctors-a...
1•bookofjoe•10m ago•1 comments

Americans hate AI so much that politicians are losing their jobs over it

https://fortune.com/2026/07/14/voters-ai-backlash-politicians-lose-seats/
2•arto•10m ago•0 comments

What I got wrong about FIRE

https://www.businessinsider.com/fire-movement-followers-modern-work-hustle-culture-solution-2026-7
1•petethomas•11m ago•0 comments

Carmakers Don't Think They Should Have to Fix Blindingly Bright Headlights

https://www.thedrive.com/news/carmakers-dont-think-they-should-have-to-fix-blindingly-bright-head...
1•randycupertino•15m ago•0 comments

Opaque, Interoperable Passkey Records (and a Go API)

https://words.filippo.io/passkey-record/
2•gnabgib•16m ago•0 comments

Gavin Newsom's return-to-office rules are stricter than many states

https://calmatters.org/politics/2026/07/newsom-return-to-office-states/
1•cdrnsf•16m ago•0 comments

Colibrì proof-of-concept gains frontier-level 1.5-TB AI model

https://www.tomshardware.com/tech-industry/artificial-intelligence/colibri-proof-of-concept-gains...
1•smoyer•18m ago•0 comments

Show HN: A Job Board for European Defence Companies

https://www.defencejobseu.com/
1•Collusus96•18m ago•0 comments

Throw, Result, or Neither?

https://www.architecture-weekly.com/p/throw-result-or-neither
3•birdculture•19m ago•0 comments

I asked Claude one question and accidentally built an intervention

https://claudeholic.me/
1•jgalego•19m ago•0 comments

Show HN: Internet Speed Atlas, a browser-measured ranking of 119 countries

https://speedof.me/internet-speed/
2•lastmile•21m ago•0 comments

Natural raises $30M to reinvent payments for AI agents – and take on Stripe

https://techcrunch.com/2026/07/20/natural-raises-30m-to-reinvent-payments-for-ai-agents-and-take-...
1•simonpure•21m ago•0 comments

Extreme Value Theory: Looking for the unusual (2021)

https://www.lancaster.ac.uk/stor-i-student-sites/owen-li/2021/02/14/extreme-value-theory-looking-...
1•gone35•27m ago•0 comments

Claude Code now has a screen reader mode

https://twitter.com/i/status/2079315549163778366
1•Hussain04•29m ago•0 comments

Is there a global loneliness epidemic? Research paints a complex picture

https://theconversation.com/is-there-really-a-global-loneliness-epidemic-research-reveals-a-more-...
4•billybuckwheat•31m ago•0 comments

InvisiCaps: The Fil-C Capability Model

https://fil-c.org/invisicaps
2•birdculture•32m ago•1 comments

Anecdotes Everywhere, Evidence Almost Nowhere (The State of AI in Mid-2026)

https://secondthoughts.ai/p/impact-of-ai
1•Kotlopou•37m ago•0 comments

The Trust Ceiling: The invisible limit on what AI is allowed to do

https://williamtp.substack.com/p/the-ai-trust-ceiling
1•williamtp•39m ago•1 comments

The AI Industry Just Got What It Deserved [video]

https://www.youtube.com/watch?v=9nUmVktlwvA
1•Jazgot•41m ago•0 comments

Stop Blaming QA and Start Diagnosing the Hidden Inefficiencies

https://dl.acm.org/doi/pdf/10.1145/3800646.3800650
2•andrewdutton•45m ago•1 comments

What It's Like to Lead an Engineering Org: Thoughts on "CTO in the Loop"

https://www.mooreds.com/wordpress/archives/3745
2•mooreds•49m ago•0 comments

Some writing keeps traveling and I can't predict which

https://www.tsoon.com/posts/writing-that-travels/
1•mooreds•49m ago•0 comments