Skip to content

Support Secure Hashed Client Secrets in OAuthRegisteredClientsStore #1124

@nazoking

Description

@nazoking

Is your feature request related to a problem? Please describe.
Currently, the OAuthRegisteredClientsStore interface does not support storing hashed client secrets or verifying them using standard password hashing algorithms. As a result, implementations often store client secrets in plaintext and compare them directly. This is not aligned with security best practices and creates a considerable risk if the storage backend is compromised.

Describe the solution you'd like
Add a method such as verifyClientSecret(clientId: string, clientSecret: string): Promise<OAuthClientInformationFull | undefined> to the store interface. This would allow secrets to be stored hashed and checked securely. The client authentication middleware should be refactored to use this method, supporting both new secure storage and legacy plaintext secrets where needed. Documentation or migration guidance should be provided for transitioning existing implementations.

Describe alternatives you've considered

  • Continuing to use getClient and maintain direct string comparisons, but this does not mitigate the mentioned security risks.
  • Wrapping or extending the current interface externally for hashing support, but this leads to fragmentation and inconsistencies among implementations.

Additional context

  • Algorithms like bcrypt or Argon2 are widely used for secure password and secret hashing.
  • Related files: src/server/auth/middleware/clientAuth.ts, src/server/auth/clients.ts
  • A clear migration or compatibility path for legacy secrets is important to avoid breaking existing deployments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Nice to haves, rare edge casesauthIssues and PRs related to Authentication / OAuthenhancementRequest for a new feature that's not currently supportedhelp wantedContributions especially welcome if you have a good knowledge of the codebase and languageneeds decisionIssue is actionable, needs maintainer decision on whether to implementv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes

    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