Spring/Spring Security

    Security - WebsecurityConfigurerAdapter Deprecated 대체

    Spring Security 5.7.0-M2 부터 websecurityconfigureradapter는 컴포넌트 기반의 보안 설정을 권장한다는 이유로 Deprecated 처리되었다. 그래서 다른 방식으로 시큐리티 설정을 권장한다. https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter 어떻게 바뀌었나 기존에 다음과 같이 사용했던 방식은 @Configuration @EnableWebSecurity public class SecurityConfiguration extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSe..

    Spring security - Role vs Authority (hasRole? hasAuthority?)

    Spring security - Role vs Authority (hasRole? hasAuthority?) Role과 Authority의 사전적 의미 Role : 역할 Authority : 권한 이 둘은 비슷하면서도 다르다. 역할은 커뮤니티 관리자가 권한을 그룹화하고 사용자 또는 사용자 그룹에 권한을 지정하는 방법을 제공한다. 권한은 커뮤니티에서 사용자가 수행할 수 있는 조치를 정의한다. 소규모 프로젝트에서는 Role이나 Authority 둘 중 한가지로 사용해서도 충분히 접근제어를 할 수 있지만, 규모가 커지고 요구사항이 복잡해진다면 역할과 권한을 분리하여 명시함으로써 유지보수성도 높아질 것이다. Spring Security는 메소드 수준에서 권한 부여 의미를 지원하는데, 이 둘이 차이가 있다. 또한..