Scrivio Interview library
LeadershipPrincipal6 min read · updated 12 November 2026

Your company wants to open its APIs to third-party developers and partners. What identity and OAuth2 strategy would you set for this developer ecosystem over the long term?

I would build on standard OAuth2 only: authorization code with PKCE when a third-party app acts for a user, client credentials when a partner system acts for itself. Scopes become a stable public contract with consent screens users understand, clients are registered self-service with a review step, secret rotation and revocation, usage is monitored and rate limited per client, and scopes and APIs are versioned and retired with published notice periods.

Why this question is asked

Opening APIs to outside developers changes who our users are. Inside the company, a breaking change costs a meeting; outside, it breaks products we have never seen, run by companies that have their own customers. Identity is at the centre of this, because every call from a third party carries delegated trust: a user allowed an app to act for them, or a partner was allowed to act for itself. Interviewers ask this to see whether a senior engineer can set a strategy that stays safe and stable for years. In this answer, we will choose the flows, design scopes as a contract, set up client registration and its life cycle, monitor and limit usage, and plan how scopes and APIs change over time.

1Two Kinds of Third-Party Access

There are two different situations, and each has its own standard flow. In the first, a third-party app wants to act on behalf of one of our users, for example a budgeting app reading a customer's transactions. The user must agree, so we use the authorization code flow with PKCE: the user logs in at our identity provider, sees what the app asks for, and approves. PKCE, Proof Key for Code Exchange, binds the code to the app that started the flow, which matters because many third-party apps are mobile or browser apps that cannot keep a secret.

In the second, a partner system acts for itself, for example a logistics company pushing shipment updates. No user is involved, so we use client credentials, ideally with private_key_jwt or mutual TLS instead of a shared secret.

Just as important is what we do not offer. No implicit flow and no password grant, both removed in OAuth 2.1, and no custom token formats. Standard flows mean developers can use any mature OAuth2 library, and our security reviews cover a small, well-understood surface.

Step throughWhich flow a new integration gets
  1. New integration request
  2. Does it act for one of our users?
    YesAuthorization code with PKCE and consentNoIs it a partner's own system?
  3. Is it a partner's own system?
    YesClient credentials with key-based authNoReject: no supported use case
  4. Grant only the scopes the use case needsreviewed against the scope catalogue

4 steps in order. Play them, or step through them one at a time.

Every integration maps to one of two standard flows; anything else is a design discussion, not a new flow.

2Scopes Are a Public Contract

A scope is a named permission a client asks for, such as accounts.read or payments.write. Outside developers write code against our scope names, and users see them on the consent screen, so scopes behave like a public API. Renaming one breaks every app that requests it.

So we design them with care. We keep the catalogue small and coarse enough that people understand it: read transactions, initiate payments, manage profile, not one scope per endpoint. Each scope has an owner, a description written for end users ("See your transactions for the last 24 months"), and a risk level that decides whether apps need extra review to request it. Consent screens show those descriptions, and users can see and revoke the apps they have approved.

3Self-Service Registration With Review

Developers expect to register an app and start testing in minutes. We give them a developer portal where they create a client in a sandbox immediately, with test data and low rate limits. Production access to sensitive scopes goes through a review: who the company is, what the app does, which scopes it needs and why. That review is where we stop an app asking for payments.write when it only displays balances.

The client life cycle is part of the platform, not a support ticket. Developers can rotate secrets or upload new public keys themselves, with the old credential valid for an overlap period. We can suspend or revoke a client instantly when it misbehaves, which also invalidates its tokens. And registrations that have had no traffic for, say, twelve months are flagged and removed, so the number of live credentials does not grow forever.

4Monitoring and Limits per Client

Every token carries a client id, so we can measure everything per client: requests, errors, scopes used, unusual patterns such as a sudden jump in calls or requests from new regions. That data serves three purposes. It protects our systems, through rate limits and quotas per client and per plan. It protects users, by spotting an app that has been compromised or is scraping data. And it enforces terms, because we can see when an app uses data in ways its review did not cover.

The gateway is the natural place to apply limits, because it sees the client id on every request. Limits should return clear errors such as 429 with a Retry-After header, so honest developers can adapt.

5Planning for Change

Over several years, scopes and APIs will change. We version APIs and treat scope changes like API changes: a new scope can be added at any time, but removing or narrowing one follows a deprecation policy with a notice period, for example twelve months for general scopes, announced in the portal and by email to every client that uses it. Usage data tells us exactly who is affected, so we can contact the last users personally before the end date.

The same applies to security changes in the platform itself. When we tighten something, such as requiring PKCE for every client or moving partners from secrets to keys, we announce it with a date, offer a sandbox to test it, and track adoption per client. A predictable ecosystem is a trusted one.

6Follow-up questions

Should third parties get the same tokens as our internal services?

No. Third-party tokens should be issued for the public API audience with only the granted scopes, and validated at the edge. Internal services should receive their own internal tokens, so a third-party token never works directly against an internal API.

How do you stop scope creep, where every app asks for everything?

We make sensitive scopes cost something: a stronger review, a contractual commitment, or a separate consent. Usage monitoring then shows scopes that were granted but never used, and we ask those clients to drop them at their next review.

What would you measure to know the ecosystem is healthy?

The time from registration to first successful call, the share of clients on current API and scope versions, the number of security incidents per client, and how many deprecated scopes are still in use as their end dates approach.

7Conclusion

In this answer, we set an identity strategy for a developer ecosystem. Third parties use only standard flows, authorization code with PKCE for user-delegated access and client credentials for partner systems. Scopes form a stable public contract with clear consent screens. Registration is self-service with review, secret rotation and revocation built in. Usage is monitored and rate limited per client, and scopes and APIs change through versioning and published deprecation periods.

What to say in the interviewAbout 80 seconds aloud

Open with

I would keep it boring and standard. For apps acting on behalf of our users, authorization code with PKCE and a consent screen; for partner systems acting for themselves, client credentials, preferably with private_key_jwt or mutual TLS rather than shared secrets.

Then, if they want more

No implicit or password grants and no custom token formats, so developers can use any OAuth2 library. Then I treat scopes as a public contract: a small catalogue with owners, plain descriptions that users see on the consent screen, and risk levels that decide which scopes need review.

Registration is self-service in a developer portal with a sandbox, but production access to sensitive scopes goes through a review of the company and its use case. The client life cycle is self-service too: rotating secrets or keys with an overlap, and the ability for us to suspend or revoke a client instantly.

Every request carries a client id, so the gateway applies rate limits per client and we monitor usage for abuse and terms violations. Finally, change is planned: APIs and scopes are versioned, removals follow a published notice period such as twelve months, and usage data tells us exactly whom to contact before an end date.

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.
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 wants to open its APIs to third-party developers and partners. What...": https://scrivio-interview-library.netlify.app/spring-boot/oauth2-and-oidc/d8b8dd420a/