Spring Boot 3.1 & Spring Security 6: Security Config 최적화 리팩토링 (12편)
·
Spring/Spring Security
이번에는 필요없는 필터는 없애고 최적화를 진행하기 위해 Security Config를 리팩토링 했다. 1. SecurityConfig 리팩토링 앞의 게시글을 확인해보면 작성한 코드가 있기에 변경된 메서드만 설명하겠다. 일단 나는 ssl(서버 사이드 랜더링)이기 때문에 에러페이지, 메인페이지, 회원가입, 로그인, 정적 리소스는 모두 접근을 허가해줬다. 여기서 특히 바뀐건 addFilterBefore() 이것이다. jwtAuthorizationFilter 다음 바로 customAuthenticationFilter로 가도록 했다. @Bean public SecurityFilterChain filterChain( HttpSecurity http, CustomAuthenticationFilter customAut..
Spring Boot 3 & Security 6 시리즈: JWT 로그인 폼 구현 (1편)
·
Spring/Spring Security
Spring Security를 구현하기 전에 앞으로 사용할 JWT 토큰이 어떤 것인지에 대해서 알아보자 📌 서론 JWT (JSON Web Token)는 웹에서 정보를 안전하게 전송하기 위한 컴팩트하고 독립적인 방식을 제공하는 토큰이다. JWT는 세 부분으로 구성되며, 각 부분은 점(.)으로 구분된다. 아래의 링크에서 jwt 토큰을 Encoded, Decoded 해볼 수 있다. JWT.IO JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties. jwt.io 1. JWT란 Header: Header는 JWT의 메타데이터를 포함하며, 주로 두 가지 정보를 담..