Skip to content
This repository was archived by the owner on Mar 2, 2023. It is now read-only.

3. Web Security

강교일(Mambo) edited this page Mar 12, 2020 · 8 revisions

스프링 시큐리티는 보안에 대한 적용을 쉽게 할 수 있도록 지원합니다. 일반적인 웹 애플리케이션에 스프링 시큐리티를 적용하는 것을 살펴보며 스프링 시큐리티 웹 보안 설정 및 다양한 부분에 대해서 알아봅니다.

Web Security 예제를 참고하세요

Spring Boot

자동 구성(Auto Configuration)

스프링 부트는 스프링 시큐리티에 대하여 다음의 부분을 자동으로 구성합니다.

  • Enables Spring Security’s default configuration, which creates a servlet Filter as a bean named springSecurityFilterChain. This bean is responsible for all the security (protecting the application URLs, validating submitted username and passwords, redirecting to the log in form, and so on) within your application.
  • Creates a UserDetailsService bean with a username of user and a randomly generated password that is logged to the console.
  • Registers the Filter with a bean named springSecurityFilterChain with the Servlet container for every request.

스프링 부트는 설정이 많지 않아보여도 많은 것들을 설정합니다.

  • 애플리케이션과 상호 작용하기 위한 인증된 사용자 요구
  • 기본 로그인 폼 생성
  • Bcrypt로 저장된 비밀번호 보호
  • 사용자 로그아웃
  • 보안 헤더 통합
  • 서블릿 API 메소드 통합

스프링 부트가 어떻게 자동 구성을 하는지 추적하려면 SecurityAutoConfiguration 클래스를 참고하시기 바랍니다.

Configuration

스프링 3.1+ 부터 자바 구성을 지원함에 따라 스프링 시큐리티 3.2+부터 XML 없이 쉽게 설정을 활성화할 수 있도록 자바 구성을 지원합니다.

스프링과 스프링 시큐리티의 자바 구성 지원 버전이 다름을 기억하시기 바랍니다.
또한, 스프링 시큐리티가 제공하는 자바 구성 예제도 참고하시기 바랍니다.

WebSecurityConfig

HttpSecurity

Multiple HttpSecurity

Integration

Servlet API

Concurrency Support

Jackson Support

Spring MVC

CORS

참고

Clone this wiki locally