Skip to content

Discuss DCR provider-client ownership for user logins #416

@ankitranjan7

Description

@ankitranjan7

Context

Hosted Authsome currently treats OAuth provider client configuration as admin-owned shared state: an ADMIN must configure client_id and client_secret before a USER can connect to that OAuth app. That rule makes sense for static OAuth apps because the OAuth app credentials are deployment-level configuration.

DCR providers are different. For notion_dcr, the provider supports Dynamic Client Registration, so Authsome can register a client during the login flow without any preconfigured admin-owned OAuth app credentials.

Observed behavior

On api.authsome.ai, a USER account cannot complete notion_dcr login when no provider client record exists yet. If an ADMIN logs into notion_dcr first, the generated DCR client is persisted, and USER accounts can then log in successfully.

This effectively makes DCR depend on prior ADMIN initialization, even though DCR is supposed to avoid preconfigured client credentials.

Design question

How should Authsome model provider-client ownership for DCR flows?

One possible policy:

  • Static OAuth client config (pkce, device_code) remains ADMIN-owned.
  • DCR-generated client records are system/protocol-generated and may be initialized by the first USER login when no client exists yet.
  • USERs may not manually submit client_id, client_secret, base_url, or replace an existing shared provider client.
  • Replacing, revoking, or rotating an existing DCR client remains ADMIN-owned because it affects shared deployment state.

Things to decide

  • Should a DCR-generated ProviderClientRecord remain server-scoped, or should DCR clients be scoped differently?
  • If USER-triggered DCR initialization is allowed, should the record include metadata such as source: dcr, registered_by_principal_id, or registered_by_identity?
  • Should the UI expose DCR providers differently from static OAuth providers so USERs are not blocked by missing admin configuration?
  • Does this policy apply to all DCR providers or only bundled trusted DCR providers such as notion_dcr?

Related implementation area

  • src/authsome/server/credential_service.py::save_inputs
  • src/authsome/server/credential_service.py::resume_login_flow
  • src/authsome/auth/flows/dcr_pkce.py
  • src/authsome/auth/bundled_providers/notion_dcr.json

Metadata

Metadata

Assignees

Labels

needs-triageMaintainer needs to evaluate this issuequestionFurther information is requested

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions