diff --git a/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/WebSecurityConfigurer.java b/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/WebSecurityConfigurer.java index bcb6d41c..1f1acf58 100755 --- a/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/WebSecurityConfigurer.java +++ b/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/WebSecurityConfigurer.java @@ -62,7 +62,6 @@ public class WebSecurityConfigurer extends WebSecurityConfigurerAdapter { */ private PhoneAuthenticationProvider phoneAuthenticationProvider() { PhoneAuthenticationProvider phoneAuthenticationProvider = new PhoneAuthenticationProvider(); - phoneAuthenticationProvider.setPasswordEncoder(passwordEncoder()); phoneAuthenticationProvider.setUserDetailsService(userDetailsService); return phoneAuthenticationProvider; } diff --git a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/grant/PhoneAuthenticationProvider.java b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/grant/PhoneAuthenticationProvider.java index 6359b11d..8ecc48e2 100644 --- a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/grant/PhoneAuthenticationProvider.java +++ b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/grant/PhoneAuthenticationProvider.java @@ -4,7 +4,6 @@ import cn.hutool.core.util.StrUtil; import com.pig4cloud.pig.common.security.service.PigUserDetailsServiceImpl; import lombok.Setter; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.BeanCreationException; import org.springframework.security.authentication.BadCredentialsException; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider; @@ -13,7 +12,6 @@ import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; -import org.springframework.security.crypto.password.PasswordEncoder; /** * @author hzq @@ -25,9 +23,6 @@ public class PhoneAuthenticationProvider extends AbstractUserDetailsAuthenticati @Setter private UserDetailsService userDetailsService; - @Setter - private PasswordEncoder passwordEncoder; - /** * 校验 请求信息userDetails * @param userDetails 用户信息 @@ -51,7 +46,7 @@ public class PhoneAuthenticationProvider extends AbstractUserDetailsAuthenticati if (authentication.getCredentials() == null) { log.debug("Failed to authenticate since no credentials provided"); - throw new BeanCreationException("Bad credentials"); + throw new BadCredentialsException("Bad credentials"); } // 手机号