so why maintain your own implementation of the scheme/spec when a community already does, as well as handles the vulns as they pop up and generally has more eyes looking (and fixing) issues?
Here's how I look at it; Trust my own NIH implementation of a spec and hope a user reports a vuln instead of it going undisclosed/unnoticed in the wild for years, or use a community lib that is always being scrutinized and vetted and has security professionals involved. It's a no brainer for me.
Is it? It seems like all the outsourced auth has lots and lots and lots of problems, issues, etc. along with being remarkably expensive.
I'm not saying I, personally, can do better, but it seems like auth is far from a solved problem. Especially since it seems like the difficult part of "auth" is actually "customer support" rather than any technical issue.
(I would argue that the lack of an open-source "Auth in a Box" seems to also argue that auth is far from "solved".)
Spring Security is complex and brittle, I have seen a push to use underlying libraries e.g. nimbus in real-life projects.
It is solved until you have to integrate with third party home grown implementations and providers that implement the specs except for a little bit of behavior that is not in the spec.
And while I kind of agree with you on principle, I've also seen way too many shoddy OSS libraries from "experts" that I had to rewrite to really make it a no-brainer statement.
Just like OP, I'm leaning against shoveling in dependencies if I can help it as I age.
Imagine a doctor making such statement about their field of work. Do you have a degree?
Tell you what. I'll never become a specialist if you never become a doctor. I'd rather you not refuse to admit that there are better doctors for a task than you if my health is in your hands.
I have been trying to get my head around OAuth, zero trust, Fido, SAML et al - and I am not sure I get it.
It’s not that say “JWT tokens might be dangerous” it’s how to hang it all together in a sane manner.
For example I was listening to Security Cryptography Whatever podcast and one of the guests (Chrome dev?) said obviously don’t trust everything that comes down an established TLS connection but verify / auth each request.
That’s a pretty tall order and seems to nullify quite a lot of established frameworks
But realistically I think a lot of frameworks and standards serve different needs than “smallish number high value clients”
This is a great resource to learn how to write it yourself, and things to take into consideration: https://lucia-auth.com/
IMO, this is one thing to implement carefully if need be (vs avoid altogether, as is the case of cryptography).
I also left "auth" ambiguous and didn't specify "authentication" or "authorization" because my original comment applies to both imo.
Probably because auth abstractions are so complicated is why developers started thinking auth is hard when all it was doing was putting a uuidv4 in a session_id cookie.
Like writing SQL without an ORM, developers have been psyop'ed into thinking things are so hard that they shouldn't even try.
Your home grown auth code doesn’t have the minds and the scrutiny of security experts like the go-to third party auth lib everyone uses does, nor does it have the free pen testing, security fixes, maintenance, optimizations, refactors, ever collaborative maintainers, or corporate sponsorships.
Auth is a solved problem by minds much smarter than my own. I’m glad to outsource things like that to third party deps.