Skip to content

Commit

Permalink
Lazily compose debug message in AbstractUserDetailsAuthenticationProv…
Browse files Browse the repository at this point in the history
…ider

Closes gh-16495

Signed-off-by: dae won <[email protected]>
  • Loading branch information
big-cir committed Jan 31, 2025
1 parent 2aa2e64 commit f5bdd75
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.springframework.context.MessageSource;
import org.springframework.context.MessageSourceAware;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.core.log.LogMessage;
import org.springframework.security.authentication.AccountExpiredException;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.BadCredentialsException;
Expand Down Expand Up @@ -133,7 +134,7 @@ public Authentication authenticate(Authentication authentication) throws Authent
user = retrieveUser(username, (UsernamePasswordAuthenticationToken) authentication);
}
catch (UsernameNotFoundException ex) {
this.logger.debug("Failed to find user '" + username + "'");
this.logger.debug(LogMessage.format("Failed to find user '%s'", username));
if (!this.hideUserNotFoundExceptions) {
throw ex;
}
Expand Down

0 comments on commit f5bdd75

Please sign in to comment.