-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DaoAuthenticationProvider is not usable on RHEL 8.7 with enforced FIPS mode #12873
Comments
Add a new constructor to the DaoAuthenticationProvider, which allows providing a custom PasswordEncoder to prevent instantiation of the default delegating PasswordEncoder in the default constructor. This provides a way to instantiate the DaoAuthenticationProvider on JDKs where the default delegating PasswordEncoder cannot be instantiated due to limited JCE providers for compliance reasons (e.g., FIPS). Closes spring-projectsgh-12873
Thanks, @psvo, this is now fixed in Please if you can test the SNAPSHOT it would be great to have feedback if it is working fine before the GA. The new constructor was added to |
@marcusdacoregio, I can confirm the fix merged to 5.8.3-SNAPSHOT works for me. Thank you! |
Describe the bug
Creating instance of DaoAuthenticationProvider fails due to "PBKDF2WithHmacSHA256 SecretKeyFactory not available" when running on RHEL 8.7 with enforced FIPS mode.
The problem is that the DaoAuthenticationProvider creates a default delegating password encoder and one of the delegates fails to instantiate due to limited JCE provider availability when FIPS is enforced.
There's no workaround, because the DaoAuthenticationProvider has only the default constructor which fails due to unconditionally calling
org.springframework.security.crypto.factory.PasswordEncoderFactories#createDelegatingPasswordEncoder
.The error is:
This is a regression in 5.8.2. It worked for us in Spring Security 5.7.4, because we were overwriting the default password encoder before it tried to retrieve the algorithm.
The issue was most probably introduced by PR #11904 (c50441b) as a fix for issue #10489.
To Reproduce
Expected behavior
Be able to use DaoAuthenticationProvider on RHEL 8.7 with enforced FIPS mode for JDK 11.
Allow providing a custom PasswordEncoder when instantiating DaoAuthenticationProvider to bypass the instantiation of the default delegating password encoder (PasswordEncoderFactories#createDelegatingPasswordEncoder).
The text was updated successfully, but these errors were encountered: