๋๋ฌด๋๋ฌด ์ด๋ ต๋ค.

Spring ์์ ๋ชจ๋ ํธ์ถ์ DispatcherServlet ์ ํต๊ณผํ๊ฒ ๋๊ณ ์ดํ ๊ฐ ์์ฒญ์ ๋ด๋นํ๋ Controller ์์ ๋ถ๋ฐฐํ๋ค.
์ด ๋ ๊ฐ ์์ฒญ์ ๋ํด ๊ณตํต์ ์ผ๋ก ์ฒ๋ฆฌํด์ผํ ํ์๊ฐ ์์ ๋ DispatcherServlet ์ด์ ๋จ๊ณ๊ฐ ํ์
โก๏ธ ๊ทธ๊ฒ์ด ๋ฐ๋ก !!
Filter
Spring security ๋ ์ธ์ฆ & ์ธ๊ฐ๋ฅผ ์ฒ๋ฆฌํ ๋ Filter๋ฅผ ์ฌ์ฉํ๋ค.
โก๏ธ FilterChainProxy ๋ฅผ ํตํด์ ์์ธ๋ก์ง์ ๊ตฌํํ๋ค.


: ์ธ์ฆ์ด ์๋ฃ๋ ์ฌ์ฉ์์ ์์ธ ์ ๋ณด๋ฅผ ์ ์ฅํ๋ค.
SecurityContext๋ SecurityContextHolder๋ก ์ ๊ทผ !
SecurityContext context = SecurityContextHolder.createEmptyContext();
Authentication authentication =
new UsernamePasswordAuthenticationToken(principal, credential, authorities);
context.setAuthentication(authentication);
SecurityContextHolder.setContext(context);