스프링 시큐리티 인증 및 권한처리 개요스프링에서 시큐리티를 활용한 인증 권한을 거치면 해당 사용자는 위 사진과 같은 과정을 통해 권한을 얻게 된다. 인증 / 인가 과정 중에 SecurityContextHolder 내부에 인증 객체를 저장하는데 이 인증 객체 내부에서 일반적으로 사용되는 UserDetails 내 getAuthorities()를 통해 해당 유저의 권한을 확인 할 수 있다. 코드를 통해서도 아래와 같은 방식으로 권한을 확인할 수 있다.if (authentication.getAuthorities().contains(new SimpleGrantedAuthority("ROLE_ADMIN"))) { redirectStrategy.sendRedirect(request, response, "/adm..
[Spring Security] 스프링 시큐리티 권한처리 하기
스프링 시큐리티 인증 및 권한처리 개요스프링에서 시큐리티를 활용한 인증 권한을 거치면 해당 사용자는 위 사진과 같은 과정을 통해 권한을 얻게 된다. 인증 / 인가 과정 중에 SecurityContextHolder 내부에 인증 객체를 저장하는데 이 인증 객체 내부에서 일반적으로 사용되는 UserDetails 내 getAuthorities()를 통해 해당 유저의 권한을 확인 할 수 있다. 코드를 통해서도 아래와 같은 방식으로 권한을 확인할 수 있다.if (authentication.getAuthorities().contains(new SimpleGrantedAuthority("ROLE_ADMIN"))) { redirectStrategy.sendRedirect(request, response, "/adm..
2024.06.04