- Today
- Total
목록spring security (2)
개발하는 고라니
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/Bg0YT/btqZ09X9d44/qTVynZs1esk3xwORUkcCL1/img.png)
Spring Security를 이용하면 로그인 페이지를 기본으로 제공해준다. 그 페이지의 모습은 다음과 같다. 이 때의 Security 설정은 어떤 모습일까? @Configuration @Log4j2 @EnableGlobalMethodSecurity(securedEnabled = true, prePostEnabled = true) public class SecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private CustomUserDetailsService userDetailsService; @Bean PasswordEncoder passwordEncoder(){ return new BCryptPasswordEncoder(); } @O..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/sX6Wf/btqZpfqcOZf/UtFeff2BAKTnOl2mzBnJ51/img.png)
Spring Security를 적용하여 사용자를 등록해 로그인에 성공했다면, thymeleaf에서 사용자의 정보를 출력할 수 있다. 'th:'를 쓸 것 같지만, Thymeleaf 공식 docs를 보면 예상과 다르게 JSP에서 쓰던 taglib를 사용한다. Spring Security를 JSP와 함께 써본 사람은 알겠지만 'sec:authentication="" '와 같은 것을 사용했었다. Thymeleaf + Spring Security integration basics - Thymeleaf Have you switched to Thymeleaf but your login and error pages are still using JSP? In this article we will see how to co..