Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.springframework.security.authentication.dao;

import java.util.Objects;
import java.util.function.Supplier;

import org.jspecify.annotations.Nullable;
Expand Down Expand Up @@ -43,6 +44,7 @@
*
* @author Ben Alex
* @author Rob Winch
* @author Andrey Litvitski
*/
public class DaoAuthenticationProvider extends AbstractUserDetailsAuthenticationProvider {

Expand Down Expand Up @@ -131,7 +133,8 @@ protected Authentication createSuccessAuthentication(Object principal, Authentic
throw new CompromisedPasswordException("The provided password is compromised, please change your password");
}
String existingEncodedPassword = user.getPassword();
boolean upgradeEncoding = existingEncodedPassword != null && this.userDetailsPasswordService != null
boolean upgradeEncoding = existingEncodedPassword != null
&& !Objects.equals(this.userDetailsPasswordService, UserDetailsPasswordService.NOOP)
Comment thread
jzheaux marked this conversation as resolved.
&& this.passwordEncoder.get().upgradeEncoding(existingEncodedPassword);
if (upgradeEncoding) {
String newPassword = this.passwordEncoder.get().encode(presentedPassword);
Expand Down
Loading