Why outsource your auth system?
fusionauth.io
fusionauth.io
But regardless of which "auth" was meant, I feel this part is dangerous:
Auth may be unrelated to your core competency
No, please no. Both authentication and authorization must be considered a core competency for every online service, even if you decide to partly outsource it. You can't afford to have blind spots there.
Sure, this is hyperbolic, but it does illustrate that not everything is a "core competency". There are always tradeoffs and decisions when it comes to software.
In my opinion, authentication and authorization are likely not core competencies for 99% of businesses. They are simply capabilities that just need to work and the business doesn't need to own them. This is the same with the database. Using a tool like FusionAuth, Keycloak, or SuperTokens will cover all of their needs.
Perhaps the distinction is just because something isn't a "core competency" does not mean it is not critical. And just because it isn't a "core competency" doesn't mean you can afford to be ignorant on the topic.
- the database must be secured against unauthorized or improper use
- the database must be accessed efficiently
- the database must have some degree of resilience
- the database must be recoverable
- the database must be available
Each business will have different weightings for these properties -- does a dating website care more about database security than a bank does? -- which will lead to different decisions about who should own and manage the DB.
But a business is, absolutely, a group of people who are doing things together. If you can't identify, authenticate, and authorize those people, you don't have a business. And if the database that stores that information isn't among your highest priorities, I think that business is rather misguided.
Strong agree. We're trying to strike the right balance with this problem with oso [1] (I'm a cofounder). By letting you separate the authorization logic from your code, and doing a lot of the thinking for you (how to design + implement roles etc), but ultimately the data *stays in the application*. There's such a blurry line between authZ and business logic that it doesn't make sense to fully outsource it.
Especially since we have to handle b2b clients who have their own SSO, etc.
I'd be very careful with how their pricing impacts your business as you increase your B2B clients with Enterprise Connections.
I'm honestly not trying to pitch you on anything, but when you outsource your auth* to a provider, you must consider the long term costs based on your business model and theirs.
Outsourcing auth is acceptable for saas customers. For consumer apps it's probably not a good idea, pricing models typically don't seem aligned in your favor for that.
Obviously the old system isn't going to stick around forever, but you can get a good chunk of the passwords migrated this way.
Linkedin, https://en.wikipedia.org/wiki/2012_LinkedIn_hack
Yahoo, https://en.wikipedia.org/wiki/Yahoo!_data_breaches
Or if we don't limit it to just data breaches but include compromises that would have allowed a full account takeover of any account using this identity provider in a third party app:
Apple, https://bhavukjain.com/blog/2020/05/30/zeroday-signin-with-a...
We have SuperTokens (self-hosted or SaaS I think) and Keycloak (self-hosted only if I’m not mistaken) so most people don’t need to ‘roll their own’.
But would I outsource the essential gateway to my service? Unlikely for the moment.
What I always want to avoid is anyone running "create table user ( id int(32) ... )".
> But would I outsource the essential gateway to my service? Unlikely for the moment.
Do you outsource the operation of your database? Some people would never do that, as they consider it core to their business operations and have the skills to run it. Others evaluate the options and decide that outsourcing running a database makes sense for their situation.
Engineering is all about tradeoffs.
Hum... I have never seen a system that could ditch a user table, whatever authn and authz schema it's using. (An independent authn service only makes it more complicated, because you now have redundant user tables.)
But a password column can be avoided.
As you suggest, I should have mentioned the big things to avoid are password hash and salt columns.
Knowing that the hashes are not stored on the database that most of your external interfaces access can bring a lot of tranquility, but you'll get some PII there anyway, so I'm not sure that tranquility is warranted.
No connection to and no opinion of the offering - just noting its existence.
I understand the SAAS offerings are relatively expensive, but its just such an engineering sink. Especially once you start getting into SSO, MFA, and the like. So yes, I'm 100% in favor of outsourcing it.
EDIT: Authorization is different. Absolutely keep that in your database if you can.
This service is dealing with stuff like OAuth, SAML, two factor, logging, monitoring, scaling and apparently even does authorization (from skimming) and more.
In other words, tons of stuff that many businesses don't need or want.
Google, an indie game, a SaaS, or a custom web app shop all have different security engineering requirements, including authentication, often per project.
Also outsourcing auth and not having full control over it is not feasible or even allowed for some domains or projects for a multitude of reasons. Not to mention that using an external service has at least a constant complexity cost.
That said, these kind of services are definitely worth considering for many. There is something to be said about advantages of specialization and cost-benefit as well. Reliability is not optional for an auth system, and I'm sure these engineers are really good at what they do. However the challenge would rather be convincing business, not engineering.
The risk of your home-rolled auth, with all the edge cases and requirements that go with it, vs. outsourcing to a company who's entire reputation relies on doing it properly with an army of experts, running on enterprise-grade architecture, with round the clock support/updates/ops?
Are you seriously saying that you can roll your own auth better than Auth0, Fusion etc. can do? And that the hours startups spend on setting it all up vs. an afternoon wiring in an auth-as-a-service provider is time well spent?
If you're a small company, don't risk it, don't invest time in it, just buy it it and plug it in and know that it's all enterprise-grade under the hood and you're covered (far more than you could ever afford to be).
If you're a big company, and you've done the maths and figure that the risk/effort vs. expense is worth it, fine.
We decided to handle authentication but explicitly _not_ user management or authorization.
This means our API is essentially just an OAuth2 wrapper around enterprise identity systems like Okta, Microsoft ADFS, generic SAML, OpenID Connect, etc. We don't require developers to migrate users into WorkOS, handle access policy, or "own" the user object. The primary user database always stays in the developer's app and WorkOS just serves as an authentication gateway. This turns out to be much more flexible, faster to integrate, and ultimately what developers actually want when adding advanced authentication strategies to their app (like enterprise SSO).
So I guess what I'm saying is this article title is a bit of a misnomer. It's actually about outsourcing your user management and identity infrastructure to FusionAuth, which is a much larger decision with architectural effects. And unfortunately that results in strong vendor lock-in to a platform like FusionAuth (or Auth0).
(For anyone curious, you can see more about the WorkOS approach here: https://workos.com/docs)
The core of FusionAuth isn't open source, but a good portion of the code built around the core is open source. It is free and has a large, growing community and integrates with any language.
Plus, you get the benefit of a having a company behind it that is constantly improving and updating the product.
I'd be happy to talk more about our licensing model and why we chose it if anyone is interested.
The only features that required a paid-Edition are: Connectors (connecting to LDAP and other backends), Advanced Registration Forms, and Breached Password Detection.
We are adding additional paid features as well, but our Developer Edition is reasonably priced. $125/month to start and that gets you up to 10,000 MAU. You can also test drive Developer Edition free for 14-days.
It's a complex server, but if you need to connect to lots of third party systems it may be a good choice as it has support for all sorts of things and its plugins are open-source (e.g. BitBucket plugin: https://github.com/curityio/bitbucket-authenticator)
For 99.9% of businesses, don't roll your own auth. Just don't do it. Use an auth service.
I've even migrated from my (our) own to another provider and back, including provider to provider without an issue. I was initially concerned with vendor lock-in, but it hasn't been a major problem so far. With most of them it is fairly easy to migrate without any interruption to your users (including MFA!).
The points made in the article seem equally applicable to any piece of a software service. It effectively boils down to this first line of the Maintainability section:
> There are trade-offs here
Seriously, though, while the headlines (cost, maintainability, etc) are applicable to any non-core software functionality, the arguments below the headlines are focused on authN/authZ. Security, standards compliance, auth breach consequences: these are all factors that matter more for outsourcing auth than they might, say, outsourcing your brochure website hosting, or outsourcing analytics. All outsourcing decisions will involve some of these dimensions, but with a different emphasis.
I would argue that security, standards compliance, and breach consequences apply to everything.
> but with a different emphasis
This is fair though.
I work for a large organization that incorporates multiple other businesses with millions of users under their own domains. After using Auth0 and other SaaS auth providers, we've settled on using Keycloak and are happy with it. Cost, security (you own all data) and extensibility were the driving factors.
+ If you have Java developers, you can extend its features via SPIs. Worked great for some custom authentication and migration flows we had to build for legacy systems.
+ It comes with batteries included: Install it, hook it up and for most cases you are done.
+ Redhat seems quite invested in it, so it has corporate backing. This could also be a bad thing, depending on your view of Redhat and which direction they take the product.
- It is a big pile of java. Since it works so well, even in cluster mode and containerized, we've never had to dig into its internals. But it is still a big pile of java. They are working on a rewrite with Keycloak X, but that is still in development.
Yes, true. :-) We'll see if IBM feels the same way.
https://www.servethehome.com/red-hat-goes-full-ibm-and-says-... http://techrights.org/2020/08/02/red-hat-layoffs/
It looks like Keycloak.X is going to be a slightly smaller pile of java :)
https://www.keycloak.org/2019/10/keycloak-x.html
You say you haven't had to dig into the internals at all, but has having a "big pile of java" even containerized, affected your operations significantly?
Also, I needed to apply some not-obvious environment / config changes to make it work behind HTTPS and inside a container without /dev/random being remounted.
I'm looking forward to them switching to Quarkus, which will make it more ameneable to be run in containers.
Do you happen to have experience with a large number of realms in Keycloak? I was looking at it a while ago and found conflicting opinions on how suitable realms would be to model multi tenancy in a saas. Mainly for performance reasons I think.
We did some load testing and noticed that the first thing to become a bottleneck was the database, after running 4k concurrent logins or so. I suspect we'd have to introduce propper postgres connection pooling to overcome that (we were running a single postgres instance).
You do need to watch out for the way it caches things though . I suggest to read the relevant documentation, as it works a bit differently in cluster mode https://www.keycloak.org/docs/latest/server_installation/#_o...
One thing to keep in mind as well is that if you create an SPI extension to cover a spicific usecase, you'll have to add your own metrics collection. It was a bit of overhead to configure in prometheus, since you'll end up having a metrics endpoint to scrape for each SPI.
To make it easy for the spooks to backdoor your clients systems?
Ok...