mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-03-01 02:49:11 +00:00
Lazily compose debug message in AbstractUserDetailsAuthenticationProvider
Closes gh-16495 Signed-off-by: dae won <eodnjs01477@gmail.com>
This commit is contained in:
parent
61d92e9db9
commit
6a94a294ea
@ -23,6 +23,7 @@ import org.springframework.beans.factory.InitializingBean;
|
|||||||
import org.springframework.context.MessageSource;
|
import org.springframework.context.MessageSource;
|
||||||
import org.springframework.context.MessageSourceAware;
|
import org.springframework.context.MessageSourceAware;
|
||||||
import org.springframework.context.support.MessageSourceAccessor;
|
import org.springframework.context.support.MessageSourceAccessor;
|
||||||
|
import org.springframework.core.log.LogMessage;
|
||||||
import org.springframework.security.authentication.AccountExpiredException;
|
import org.springframework.security.authentication.AccountExpiredException;
|
||||||
import org.springframework.security.authentication.AuthenticationProvider;
|
import org.springframework.security.authentication.AuthenticationProvider;
|
||||||
import org.springframework.security.authentication.BadCredentialsException;
|
import org.springframework.security.authentication.BadCredentialsException;
|
||||||
@ -133,7 +134,7 @@ public abstract class AbstractUserDetailsAuthenticationProvider
|
|||||||
user = retrieveUser(username, (UsernamePasswordAuthenticationToken) authentication);
|
user = retrieveUser(username, (UsernamePasswordAuthenticationToken) authentication);
|
||||||
}
|
}
|
||||||
catch (UsernameNotFoundException ex) {
|
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) {
|
if (!this.hideUserNotFoundExceptions) {
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user