Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Avoid eager PasswordEncoder initialization in ClientSecretAuthenticationProvider

オープン 初心者向け
#19,783 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java, spring

調査の方向性

oauth2/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/ClientSecretAuthenticationProvider.java から始め、encoder の初期化を core/src/main/java/org/springframework/security/authentication/dao/DaoAuthenticationProvider.java と比較します。PasswordEncoderFactories.createDelegatingPasswordEncoder() と SingletonSupplier の使用を確認します。デフォルトの encoder を eager に作成せずに、カスタムの FIPS-compatible encoder を指定して構築でき、public API とデフォルトの動作が維持されていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

status: waiting-for-triage type: enhancement

ClientSecretAuthenticationProvider eagerly initializes its default PasswordEncoder using PasswordEncoderFactories.createDelegatingPasswordEncoder()
in its constructor.

https://github.com/spring-projects/spring-security/blob/3d23cf3f317c685b7b75fdd7cd54cb60ee0b78cc/oauth2/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/ClientSecretAuthenticationProvider.java#L79

This factory creates legacy MessageDigestPasswordEncoder instances, including MD5. On a FIPS-compliant JDK where MD5 is unavailable, constructing ClientSecretAuthenticationProvider fails even
when a custom FIPS-compatible PasswordEncoder is configured.

https://github.com/spring-projects/spring-security/blob/3d23cf3f317c685b7b75fdd7cd54cb60ee0b78cc/crypto/src/main/java/org/springframework/security/crypto/factory/PasswordEncoderFactories.java#L78

This is similar to the issue discussed in gh-14670.

DaoAuthenticationProvider already avoids this problem by lazily initializing its default PasswordEncoder using SingletonSupplier.

https://github.com/spring-projects/spring-security/blob/3d23cf3f317c685b7b75fdd7cd54cb60ee0b78cc/core/src/main/java/org/springframework/security/authentication/dao/DaoAuthenticationProvider.java#L58

I would like to suggest to apply the same pattern to ClientSecretAuthenticationProvider, preserving the existing public API and default behavior while avoiding construction of the default encoder
when setPasswordEncoder() is used.

I would be happy to submit a PR if this approach sounds correct.

主要言語
Java
スター
9.6k
フォーク
6.4k
平均マージ
1日 20時間
マージ済み PR(30日)
54

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

spring-projects/spring-security のほかの issue

spring-projects/spring-security の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。