增加认证日志

This commit is contained in:
2023-08-30 10:12:23 +08:00
parent dbd4745763
commit 8d30230281

View File

@@ -12,6 +12,7 @@ import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.oauth2.common.exceptions.InvalidGrantException;
import org.springframework.stereotype.Component;
/**
@@ -58,9 +59,7 @@ public class Sm4AuthenticationProvider extends AbstractUserDetailsAuthentication
log.error("加密后的:"+sm4PwdTwice);
log.error("数据库的:"+businessUser.getPassword());
if(!businessUser.getPassword().equalsIgnoreCase(sm4PwdTwice)){
throw new BadCredentialsException(messages.getMessage(
"AbstractUserDetailsAuthenticationProvider.badCredentials",
businessUser.getUsername()));
throw new InvalidGrantException(businessUser.getUsername());
}
}