Quick revision
The short answer
I would start with a full inventory of every authenticator, credential type and user store, because the risk hides in special cases nobody remembers. For the identity provider itself I would buy or adopt a mature product, managed or self-hosted open source, and build only thin adapters. The move runs in phases (accept old credentials and new tokens, move clients, retire the old path by a deadline), is run as a security programme with risk ranking and audit logging, and ends with a funded central team owning the integration libraries for Dropwizard and Spring Boot.
What to remember
In this answer, we planned the move from home-grown authenticators to a central identity provider. We began with an inventory that exposes hidden special cases, chose to buy or adopt a mature provider and build only thin adapters, and migrated in phases: accept both, move clients, retire the old path by a deadline. We ran it as a security programme with risk ranking, audit logging and incident readiness, and funded a central team to own identity integration for both stacks afterwards.
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 start with a full inventory of every authenticator, credential type and user store, because the risk hides in special cases nobody remembers. For the identity provider itself I would buy or adopt a mature product, managed or self-hosted open source, and build only thin adapters. The move runs in phases (accept old credentials and new tokens, move clients, retire the old path by a deadline), is run as a security programme with risk ranking and audit logging, and ends with a funded central team owning the integration libraries for Dropwizard and Spring Boot.
Why this question is asked
Legacy authentication is one of the riskiest kinds of code to inherit: it guards everything, nobody who wrote it is around, and its failures are silent until someone exploits them. Interviewers ask this at senior levels because the answer needs judgement more than code: what to find out first, whether to build, how to change something everyone depends on without locking people out, and who owns it afterwards. In this answer, we will walk through the inventory, the build-or-buy decision with its real costs, a phased migration, the security framing, and the ownership model.
1Start With an Inventory, Not a Design
Before choosing anything, we need to know what exists. For each service we record which authenticator it uses, which credential types it accepts (passwords, API keys, basic auth, session cookies, signed headers), which user store it reads, who its callers are and how many requests per day each kind of credential carries.
This step always finds surprises, and they are the real work. Typical findings are service accounts that share one password across ten systems, a hard-coded master key for an old batch job, an admin flag stored in a column nobody else knows about, password hashes in an old format such as unsalted SHA-1, and a partner integration that sends credentials in a query string. Each of these becomes a line on a risk register with an owner. Request logs are the best source: we add a small log line to each old authenticator that records the credential type and the client, never the secret, and after two weeks we know what is really used.
2Build or Buy the Identity Provider?
An identity provider looks simple from the outside, but it includes secure password storage, multi-factor authentication, account recovery, OAuth2 and OIDC flows, token signing and key rotation, session management, brute-force protection, audit trails and a steady stream of security fixes. Each of those is a place where a small mistake is a breach. Building it in-house means a team of several engineers for years, plus the risk that we get something subtly wrong.
So for almost every company the answer is to buy or adopt: a managed service, or a mature self-hosted open-source server such as Keycloak if we must keep identity data on our own infrastructure. What we build is thin: adapters that connect the provider to our legacy user database during migration, the Dropwizard and Spring Boot integration libraries, and the provisioning glue with our HR or customer systems. A useful comparison is total cost over three years: licence or hosting cost against the salaries of the team we would need, plus the cost of one serious incident.
| Option | Upfront cost | Ongoing cost | Main risk |
|---|---|---|---|
| Build our own IdP | high: 4 to 6 engineers | permanent security team | subtle flaws, slow fixes |
| Managed IdP service | low: integration work | per-user licence fees | vendor lock-in, data location |
| Self-hosted open source | medium: setup and HA | upgrades, operations | patching discipline |
| Buy + thin adapters | medium | small platform team | adapter quality |
3Migrating in Phases
We never switch everyone at once. In phase one, each service accepts both the old credential and the new token. The platform library adds the new JWT path next to the old authenticator, and both produce the same principal type, so resource code does not change. Users can be migrated lazily: the provider's user federation feature checks the legacy database on first sign-in, verifies the old password, and stores it in its own format, so nobody needs a password reset.
In phase two, we move the clients: web apps switch to OIDC sign-in, batch jobs and services get their own client credentials, and partners get new keys with a support window. The dashboards from the inventory show the share of traffic still using old credentials per service. In phase three, we announce a deadline, for example 90 days, switch the old path to log-only warnings for a test period, and then remove it. Removing the code matters; a disabled authenticator that is still deployed is still an attack surface.
- Inventory and risk registerevery authenticator, credential and user store
- Accept bothold credentials and new tokens, same principal
- Move clientsapps to OIDC, jobs to client credentials
- Old credential traffic near zero?YesAnnounce the deadlineNoChase the remaining clients
- Remove the old pathdelete code, rotate shared secrets
5 steps in order. Play them, or step through them one at a time.
Each phase is measured by the share of traffic still on old credentials.
4Treating It as a Security Programme
This is not only a refactoring, because the old code is itself a security risk and the migration creates temporary ones, such as two paths that both grant access. So we rank services by risk: internet-facing ones holding personal or payment data go first, internal read-only tools last. Every authentication decision on both paths is audit-logged with who, when, from where and which method, so we can investigate if something goes wrong.
We also prepare for incidents before they happen. The security team knows the timeline, there is a runbook for revoking all tokens of a client, and shared secrets found in the inventory are rotated as soon as each client moves, not at the end. A penetration test of the new setup before the deadline is cheap insurance.
5Funding Ownership So It Does Not Rot Again
The original problem was that each team wrote its own authenticator and then left. If we finish the migration and walk away, the same thing happens to our adapters. So part of the plan, agreed with leadership at the start, is a small central team, two or three engineers, that owns the identity integration libraries for both Dropwizard and Spring Boot, the provider's configuration, the conformance tests and the upgrade schedule.
Product teams then own only their authorisation rules, which they understand best. That split, central identity and local permissions, is the lasting result of the programme, and it is what we report to leadership alongside the numbers: authenticators removed, shared secrets rotated and the share of traffic on the new tokens.
6Follow-up questions
How do you migrate password hashes you cannot read?
We do not need to read them. With lazy migration, the identity provider receives the user's password at sign-in, checks it against the legacy hash through a federation adapter, and on success stores it with its own modern hash. Users who never sign in during the window are migrated with a forced reset at the end. If the legacy format is one the provider supports, such as bcrypt, a bulk import is possible too.
What if a team says their special case cannot move?
We treat it as a finding, not a veto. Usually the special case is a service account or a partner protocol, and the provider supports it through client credentials or a dedicated client. If something truly cannot move yet, it gets an explicit exception with an owner, compensating controls such as network restrictions, and a review date, so it stays visible on the risk register.
How do you keep teams motivated during a long migration?
Make the new path easier than the old one: the platform library is the default in templates, sign-in works out of the box, and teams stop handling password resets. Publish progress openly per service, and tie the deadline to a concrete security reason that leadership supports, so the work is planned rather than squeezed between features.
7Conclusion
In this answer, we planned the move from home-grown authenticators to a central identity provider. We began with an inventory that exposes hidden special cases, chose to buy or adopt a mature provider and build only thin adapters, and migrated in phases: accept both, move clients, retire the old path by a deadline. We ran it as a security programme with risk ranking, audit logging and incident readiness, and funded a central team to own identity integration for both stacks afterwards.
Open with
I'd start by finding out what we actually have: every authenticator, every credential type it accepts, every user store and who calls it, using a small log line in each old authenticator that records the method and client, never the secret.
Then, if they want more
That always turns up special cases like shared service-account passwords or old hash formats, and each goes on a risk register with an owner.
On build versus buy, I'd buy or adopt a mature provider, managed or something like Keycloak self-hosted, because an identity provider means MFA, recovery, key rotation and constant security fixes, and building that is years of a team's time with a lot of risk.
We build only thin adapters: federation to the legacy user database for lazy password migration, and integration libraries for Dropwizard and Spring Boot.
Migration is phased: services accept both old credentials and new tokens with the same principal, we move clients and track the share of old traffic, then retire the old path by an announced deadline and delete the code. I'd run it as a security programme, riskiest services first, audit logging on both paths, secrets rotated as clients move.
And I'd get a small central team funded to own the libraries afterwards, so this doesn't rot again.
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 official documentation for the version you use. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
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 "Older Dropwizard services each contain home-grown authenticators backed by a legacy user...": https://scrivio-interview-library.netlify.app/java/dropwizard/3675444e8c/