[Spring Security] Authentication의 메커니즘
·
Web & Android/Spring Security
Authentication에는 인증된 결과 뿐만 아니라 인증을 하기 위한 정보, 인증을 받기 위한 정보가 하나의 객체에 들어가 있음 AuthenticationProvider는 입력된 인증을 보고 허가된 인증을 내주는 방식으로 인증 허가를 판단하며 처리 가능한 Authentication에 대해서 알려주는 support메서드를 지원 Authorities에는 '어디를 갈 수 있는지', '어떤 역할을 할 수 있는지'에 대한 권한 정보로 이를 구현(implement)한 GrantedAuthority에 관한 정보들이 저장되어있음 Authentication에 들어가 있는 Token들은 각각의 Filter들을 통해 발행된 Token들 Credentials은 인증을 받기 위해 필요한 정보들로 대표적인 예시로는 비밀번호 ..
[Spring Security] Authentication의 구조
·
Web & Android/Spring Security
Spring에서 로그인을 한다는 것은 SecurityContext가 authenticated가 true인 Authenticaiton(인증) 객체를 갖고 있는 상태 → 이때 authintication(인증)은 AnonymousAuthenticationToken이 아니어야 함! SecurityContextHolder(인증보관함 보관소)는 인증을 보관하는 보관소이며 Authentication(인증)을 갖고 있는 SecurityContext(인증보관함)를 보관 AuthenticationProvider(인증 제공자)은 Authentication(인증)을 제공하며 이는 여러개가 존재할 수 있음 AuthenticationProvider(인증 제공자)를 관리하는 Interface를 AuthenticationManage..