Design OIDC Login and Third-Party Tool Authorization
Design shared login across first-party sites plus consented, revocable access to external tools.
Problem statement
For this exercise, assume a multi-tenant product has several first-party web sites that use one OpenID Connect identity service for login.
After signing in, an authorized workspace user may connect an external tool, grant a bounded set of provider scopes through that provider's authorization flow, and let approved product features act through that connection.
Product services must distinguish authentication of the user, workspace policy, user consent, provider-granted scopes, and the credential actually used for an external call.
Assume providers support authorization-code grants with refresh tokens but differ in scope names, token lifetimes, revocation behavior, and outage characteristics.
Store provider credentials encrypted, never expose them to browsers or ordinary application logs, and audit consent, use, refresh, failure, and revocation without recording secrets.
Workspace administrators can restrict which tools and scopes are allowed; a user can disconnect a tool; and removed access must stop new calls within 60 seconds.
Custom provider password collection, unrestricted arbitrary tools, provider account provisioning, billing, and the internal business logic of each tool are outside scope.
What to build
- A user can sign in to authorized first-party sites through one OIDC identity service and receive a site-specific authenticated session.
- An eligible user can connect a supported external tool through provider-hosted consent for scopes permitted by workspace policy.
- A product service can request an external tool action only when the current user, workspace policy, consent grant, provider scopes, and target connection all authorize it.
- A user or administrator can disconnect access, block new calls within 60 seconds, and review secret-free audit evidence for grant and credential use.
At scale
- For this exercise, assume 10 million users across 100,000 workspaces, five first-party sites, and one million active external-tool connections.
- For this exercise, assume peaks of 5,000 OIDC login flows, 20,000 tool-authorization decisions, and 5,000 token refreshes or external calls per second.
- For this exercise, target 99.99 percent monthly availability for login and authorization decisions, while external-provider outages may degrade only the affected tool.
- For this exercise, policy changes or disconnects must block new tool calls within 60 seconds, and secret-free audit events are retained for one year.