ALOHA CLASS
/
Back-End
/
Spring Security
Search
Share
μ€νλ§ μν리ν°
μ΄ νμ΄μ§μ λ΄μ©μ Spring Security 6 μ΄μ λ²μ μ κΈ°μ€μΌλ‘ μ€λͺ νκ³ μμ΅λλ€.
β’
Spring Security 6 μ΄μ
β’
Spring Boot 3.x.x
β’
MySQL
β’
MyBatis
Spring Security 5.7 μ΄μ :
SecurityFilterChain
λΉ λ±λ‘ λ°©μ
Spring Security 5.7 λ―Έλ§ :
WebSecurityConfigurerAdapter
μμ ꡬν λ°©μ
Spring Security
SpringSecurity6
SecurityFilterChain
μ΄ νμ΄μ§μ λ΄μ©μ Spring Security 5.7 λ―Έλ§ λ²μ μ κΈ°μ€μΌλ‘ μ€λͺ νκ³ μμ΅λλ€.
β’
Spring Security 5.7 λ―Έλ§
β’
Spring Boot 2.x.x
β’
MySQL
β’
MyBatis
Spring Security 5.7 λ―Έλ§ :
WebSecurityConfigurerAdapter
μμ ꡬν λ°©μ
Spring Security 5.7 μ΄μ :
SecurityFilterChain
λΉ λ±λ‘ λ°©μ
Spring Security
SpringSecurity5.7
WebSecurityConfigurerAdapter
CSRF TOKEN μ μμ² ν€λμ λ΄μμ£ΌμΈμ!
AJAX + Spring Security
μλ¬ λ©μμ§
νμ
HTML μμ form μ csrf ν ν°μ μΆκ°νλ κ²½μ°μ, HTML μ΅μλ¨ λΆν° ν ν° input hidden νκ·ΈκΉμ§ μ½λκ° μμ² κΈΈλ©΄, κ·ΈλΆλΆμ ν ν°μ νμνμ§ λͺ»νκ³ κ·Έ μ΄ν μ½λλΆν° μΆλ ₯λμ§ μλ μλ¬κ° λ°μν¨.
ν΄κ²°
head νκ·Έ μμ meta νκ·Έλ‘ HTML μ΅μλ¨λΆν° κ°μ₯ 짧μ μμΉμ csrf ν ν°μ΄ λ±μ₯νκ² νλ©΄ νμμ΄ ν΄κ²°λλ€.
CSRF ν ν° μλ¬