Quick revision
The short answer
I would structure it around requirements and total cost. Keycloak gives control, no per-user licence and broad protocol support, but we own uptime, upgrades, patching, scaling and expertise; a commercial provider adds managed operations, threat detection and support, at per-user prices with data residency questions and lock-in. So we list the requirements (customer or workforce identity, MFA and passkeys, federation, compliance, user numbers and growth), estimate cost over several years including the team and incidents, and reduce lock-in either way by keeping applications on standard OAuth2 and OIDC.
What to remember
In this answer, we structured the Keycloak decision. Keycloak offers control, no per-user licence and broad protocol support, but we own its operation; a commercial provider offers managed operations, threat detection and support at per-user cost with residency questions and lock-in. We listed the requirements that decide it, estimated cost over several years including the team and incidents, and kept the choice reversible by keeping applications on standard OAuth2 and OIDC with our own claims contract.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
I would structure it around requirements and total cost. Keycloak gives control, no per-user licence and broad protocol support, but we own uptime, upgrades, patching, scaling and expertise; a commercial provider adds managed operations, threat detection and support, at per-user prices with data residency questions and lock-in. So we list the requirements (customer or workforce identity, MFA and passkeys, federation, compliance, user numbers and growth), estimate cost over several years including the team and incidents, and reduce lock-in either way by keeping applications on standard OAuth2 and OIDC.
Why this question is asked
Teams that have run Keycloak for a few years often reach this point after a painful upgrade or an audit: the system works, but it takes more people than anyone planned, and a vendor's sales team is offering to make the problem go away. Interviewers ask this design question to see whether we can turn an emotional debate into a structured decision. In this answer, we will set out what each option really offers, write down the requirements that decide it, estimate the cost over several years, and look at how to keep either choice reversible.
1What Staying on Keycloak Offers and Costs
Keycloak is an open source identity provider with broad protocol support: OpenID Connect, OAuth2, SAML, identity brokering to other providers, user federation with LDAP and Active Directory, and fine-grained customisation through extensions and themes. There is no licence fee per user, which matters at large scale, and we decide where it runs and where the data lives.
The cost is everything around the software. We own uptime across zones, upgrades every few months with their migration notes, security patching on short notice, database and cache sizing as users grow, and the expertise to debug clustering at 3 a.m. Commercial support for Keycloak-based distributions exists, which shifts some of this, but the operation stays ours.
2What a Commercial Provider Offers and Costs
A commercial identity provider runs the service for us, with availability commitments, patching, and features that are expensive to build: threat detection such as bot and credential-stuffing protection, adaptive MFA, passkeys, polished admin and self-service, and compliance reports. Support is a phone call rather than a forum search.
In return we pay per user or per monthly active user, which grows with success, especially for customer identity. Data residency must be checked for every market we serve. And we take on lock-in, both technical (proprietary rules, hooks and SDKs) and contractual, which raises the cost of leaving later.
| Aspect | Invest in Keycloak | Commercial provider |
|---|---|---|
| Licence | none (optional paid support) | per user or per active user |
| Operations | ours: uptime, upgrades, patching, scaling | vendor's, with an SLA |
| Security features | MFA, passkeys; detection is ours to add | threat detection, adaptive MFA included |
| Customisation | extensions, themes, full control | within vendor limits |
| Data location | wherever we run it | vendor regions; check residency |
| Lock-in | low for the product, high in our own skills | proprietary features and contracts |
3Writing Down the Requirements
The decision depends on facts that differ from company to company, so we collect them first. Is this customer identity, where user numbers can reach millions and per-user pricing dominates, or workforce identity, where numbers are smaller and integration with HR systems and single sign-on to SaaS tools matter more? Which authentication methods must we offer now and in two years, such as MFA, passkeys and step-up for payments? Which federation do we need, with partners' providers or social logins? Which compliance regimes apply? How many users today, and how fast are we growing?
We also write down what is unique to us. If the honest list of special customisations is short, a commercial provider covers it. If it includes things like a custom login flow embedded in a product we ship, Keycloak's openness counts heavily.
4Estimating the Cost Over Several Years
We compare totals over, say, five years. For Keycloak, the main item is the team: running a highly available cluster for 120 applications realistically needs two to four engineers' worth of time across on-call, upgrades and support, plus infrastructure and the cost of incidents, such as the lost-session outage that prompted the discussion. For a commercial provider, the main items are licences at our projected user numbers, the migration project itself, one or two engineers to integrate and administer, and price increases at renewal.
A simple example: with 300,000 workforce and partner users, licences might come to a few hundred thousand per year, while a Keycloak team of three costs a similar amount. At that scale the decision turns on risk and features, not price. With five million customers, licences can be several times the team cost, and staying with Keycloak while investing in the team becomes attractive. We put our real numbers in, not these.
5Making Either Choice Reversible
Whatever we decide, applications should not care. They should speak only standard OAuth2 and OpenID Connect through Spring Security, read claims through a shared mapping that follows our own claims contract, and never call provider-specific admin APIs or embed provider SDKs. Provider-specific features, such as custom authenticators in Keycloak or rules in a vendor, stay at the identity layer and are documented as migration items.
If we move, we migrate in waves: applications first, by switching their issuer behind the shared configuration; users next, with password hash import where the formats allow it, or re-enrolment; and the old system retired on a date. If we stay, we fund the team properly, because the trigger for this discussion was probably under-investment rather than Keycloak itself.
6Follow-up questions
Can we keep Keycloak but reduce the operating burden?
Yes, through a supported Keycloak-based distribution with vendor support, a managed hosting offer, or by running it on a well-automated Kubernetes setup with an operator. Those reduce the work but do not remove our responsibility for upgrades and incident response.
Which signals would push you toward a commercial provider?
Repeated incidents tied to operations rather than features, difficulty hiring identity engineers, audit findings about patching speed, and requirements like advanced threat detection that we would otherwise build ourselves.
How do you migrate users' passwords?
Many providers can import common hash formats such as PBKDF2 or bcrypt, so users keep their passwords. Otherwise users can be migrated lazily: on their first login the new provider checks the password against the old system, then stores its own hash.
7Conclusion
In this answer, we structured the Keycloak decision. Keycloak offers control, no per-user licence and broad protocol support, but we own its operation; a commercial provider offers managed operations, threat detection and support at per-user cost with residency questions and lock-in. We listed the requirements that decide it, estimated cost over several years including the team and incidents, and kept the choice reversible by keeping applications on standard OAuth2 and OIDC with our own claims contract.
Open with
I would turn it into a structured decision rather than a debate. First, what each option really means. Staying on Keycloak gives us control, broad protocol support including SAML and brokering, no per-user licence, and data wherever we run it, but we own uptime, upgrades, security patching, scaling and the expertise to debug it.
Then, if they want more
A commercial provider gives managed operations with an SLA, threat detection, adaptive MFA and support, but we pay per user, must check data residency for each market, and accept some lock-in. Second, I write down the requirements: customer or workforce identity, MFA and passkeys, federation needs, compliance, and user numbers with growth. Third, I estimate cost over five years.
For Keycloak the big item is the team, two to four engineers' worth of time, plus infrastructure and incidents; for a vendor it is licences at projected user numbers, migration and renewals. At workforce scale these are often similar and the decision turns on risk; at millions of customers licences usually dominate.
Whatever we choose, applications stay on standard OAuth2 and OIDC through Spring Security with our own claims contract and no provider SDKs, so we can change later. If we stay, I would insist on funding the team properly.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- RFC 6749, The OAuth 2.0 Authorization Framework, Spring Security reference, OAuth2
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Your company considers moving from a self-hosted Keycloak to a commercial identity...": https://scrivio-interview-library.netlify.app/spring-boot/oauth2-and-oidc/ab756f03c0/