Skip to content

Let embedders declare provisioned OAuth clients in the auth server config #6937

Open

Description

@jhrozek

Summary

Let an application that embeds the auth server declare its own OAuth clients in authserver.Config. The auth server then writes those clients to storage at every startup and owns them, the same way it already owns configured delegate clients.

Motivation

Today, an embedder that needs a fixed internal client, for example a public PKCE client used by its own UI flow, writes it straight into storage with ClientRegistry.RegisterClient before it starts the server. Then the embedder has to:

  • check for drift by hand: compare the stored client with the one it expects, and decide what to do when they differ;
  • keep track of the client for its whole lifetime: renaming or retiring the client leaves the old row in storage;
  • make it behave the same on the memory and Redis backends.

Configured delegate clients already avoid all of this. They are declared in config and reconciled into storage at startup. Embedder clients should work the same way.

Proposal

  • Add Config.ProvisionedClients []fosite.Client (Go API only, not part of RunConfig or the CRD).
  • At startup, write each client with ReconcileConfiguredClient, next to the delegate client registration. That covers drift correction and the cross-replica conflict checks, as it does for delegates.
  • Treat config as the only source of truth. A client removed from the list is no longer served after a restart, as with delegate clients.
  • Validation: reject nil clients, DCR-marked clients, URL-shaped IDs (they are reserved for CIMD), duplicate IDs, and collisions with delegate or SPIFFE client IDs.
  • Document the migration for embedders that call RegisterClient today: replace the call and the drift check with the config entry.

Notes

  • A client served only from an in-memory overlay, with no stored row, was considered and rejected. The Redis backend rebuilds authorization-code and refresh-token sessions from the stored client row, so interactive clients need a row.
  • Rolling updates where replicas run different configs would overwrite each other's rows. That is the same behaviour as delegate clients today.
  • This builds on in-flight work on configured clients in the embedded auth server. Implementation should start after that lands.

Activity

  1. added
    needs-triage
    on Oct 24, 2026
  2. removed
    needs-triage
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authenticationenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions