본문 바로가기
728x90
반응형

Spring Security4

[Security] 로그인과 권한 설정 주의 : Spring Security 5.7+ (Spring Boot 2.7+)부터는 WebSecurityConfigurer이 Deprecated 되었다. 2022.09.05 - [Spring/Security] - [Security] WebSecurityConfigurerAdapter Deprecated [Security] WebSecurityConfigurerAdapter Deprecated 버전 Java 11 Spring boot 2.7.3 Deprecated Spring Security 5.7.0-M2부터 Deprcated 되었다. (SpringBoot 기준 2.7 이후) WebSecurityConfigurerAdapter : WebSecurityConfigurer의 인스턴스를 생성하여 Abstra.. 2022. 11. 1.
[Security] 스프링 시큐리티의 아키텍처(구조) 및 흐름 Spring Security 스프링 시큐리티리란? 어플리케이션의 보안(인증 및 권한)을 담당하는 프레임워크 Spring Security를 사용하지 않으면 자체적으로 세션을 체크해야 한다. redirect를 일일이 설정해주어야 한다. 로그인 완료 시 다음 화면으로 넘어가기 등 특징 Filter를 기반으로 동작한다. SpringMVC와 분리되어 관리하고 동작할 수 있다. bean으로 설정할 수 있다. Spring Security 3.2부터 XML 설정을 이용하지 않아도 된다. 용어 접근 주체(Principal) : 보호된 대상에 접근하는 유저 인증(Authenticate) : 현재 유저가 누구인지 확인(로그인) 어플리케이션의 작업을 수행할 수 있는 주체임을 증명한다. 인가(Authorize) : 현재 유저의.. 2022. 11. 1.
Spring Security 기능을 제거하는 간단한 방법 build.gradle에서는 Spring Security 의존성을 추가했지만, 아직 인증단계를 개발하지 않은 경우 Application에서 exclude를 이용해 Security 기능을 꺼둘 수 있다. @SpringBootApplication(exclude = SecurityAutoConfiguration.class) public class FeedApplication { public static void main(String[] args) { SpringApplication.run(FeedApplication.class, args); } } 쿠팡으로 연결 클릭 제주삼다수 그린 COUPANG www.coupang.com 파트너스 활동을 통해 일정액의 수수료를 제공받을 수 있음 2021. 9. 16.
[Spring Security] defaultSuccessUrl, successForwardUrl, successHandler 참고 : https://www.codejava.net/frameworks/spring-boot/spring-boot-security-customize-login-and-logout defaultSuccessUrl Spring Security는 인증이 필요한 페이지에 사용자가 접근하면, 로그인 페이지로 이동시킨다. 로그인이 성공하면 사용자가 처음에 접근했던 페이지로 리다이렉트 시켜준다. 사용자가 로그인하기 전에 방문했던 페이지가 아닌, 다른 페이지를 원한다면 defaultSuccessUrl을 사용한다. http.formLogin().defaultSuccessUrl("/login_success"); successForwardUrl 로그인이 성공한 후 보내는 Url 특정 url을 호출하여 다른 로직을 한 번 .. 2021. 9. 1.
LIST