Spring Legacy project에서는 encrypt기능만 별도로 사용 가능했는데,
Boot에서는 Security라이브러리의 일부 기능으로 되어있다.
Security를 설치하고 SecurityConfig에서 WebSecurityConfigurerAdapter를 implements하면 되지만,
현재는 완전히 Deprecated되어 이전버전을 설치해도 implements 할 수 없다.
현재는 @Bean 방식으로 주입을 해줘야 한다
@Configuration
public class SecurityConfig {
@Bean
public PasswordEncoder getPAsswordEncoder() {
return new BCryptPasswordEncoder();
}
}
원하는 클래스에 주입 해준다.
private final PasswordEncoder passwordEncoder;
public MemberServiceImpl(PasswordEncoder passwordEncoder) {
this.passwordEncoder = passwordEncoder;
}
'개발일기' 카테고리의 다른 글
실행파일 생성과정 (1) | 2023.12.11 |
---|---|
HTTP와 HTTPS의 차이점 (0) | 2023.12.10 |
단순히 JWT를 이용한 로그인,로그아웃 구현 느낀점 (0) | 2023.01.02 |
비전공 개발자로서 개발 공부하는것... (0) | 2022.12.30 |
현재 로그인ID를 파라미터로 받는 방법...? (0) | 2022.12.28 |