Spring 정리ver2/Security 5

[baeldung] Find the Registered Spring Security Filters

더보기 https://www.baeldung.com/spring-security-registered-filters Spring Security는 서블릿 필터 체인을 기반이다 각 필터에는 특정 책임이 있고, 구성에 따라 필터를 추가하거나 제거한다 Security Debugging 각 요청에 대한 자세한 보안 정보를 기록하는 보안 디버깅의 활성여부이다 debug 속성을 사용하여 보안 디버깅을 활성화할 수 있다 @EnableWebSecurity(debug = true) 이렇게 하면 서버에 요청을 보낼 때 모든 요청 정보가 기록된다 그리고 전체 보안 필터 체인을 볼 수 있다 Security filter chain: [ WebAsyncManagerIntegrationFilter SecurityContextPers..

[baeldung] Default Password Encoder in Spring Security 5

더보기 https://www.baeldung.com/spring-security-5-default-password-encoder Spring Security 4에서는 메모리 내 인증을 사용하여 일반 텍스트로 비밀번호를 저장할 수 있었다. 그러나 Spring Security 5는 암호 관리 프로세스에 대한 대대적인 점검으로 암호 인코딩 및 디코딩을 위한 보다 안전한 기본 메커니즘이 도입되었다 Spring Security 4 We'll start by showing a standard security configuration that provides simple in-memory authentication Spring 4 의 예시 @Configuration public class InMemoryAuthWeb..

[baeldung] Control the Session with Spring Security

XML 은 안적음**** 더보기 https://www.baeldung.com/spring-security-session Spring Security가 HTTP 세션을 제어할 수 있는 방법 When Is the Session Created? We can control exactly when our session gets created and how Spring Security will interact with it: always – A session will always be created if one doesn't already exist. ifRequired – A session will be created only if required (default). never – The framework wil..

[baeldung] Intro to Spring Security Expressions

더보기 https://www.baeldung.com/spring-security-expressions Configuration Java configuration @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) @ComponentScan("com.baeldung.security") public class SecurityJavaConfig { ... } XML configuration 밑에 XML 예제는 안씀.. Web Security Expressions Now let's explore the security expressions: hasRole, hasAnyRole hasAuthority, hasAny..

[baeldung] Retrieve User Information in Spring Security

더보기 https://www.baeldung.com/get-user-in-spring-security Spring Security를 이용하여 사용자 세부 정보를 검색할 수 있다 Get the User in a Bean The simplest way to retrieve the currently authenticated principal is via a static call to the SecurityContextHolder 현재 인증된 보안 principal 값을 가져오려면 SecurityContextHolder 를 호출한다 Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (!(authent..

728x90