프로젝트 구성 및 의존성 추가


dependency 추가

  1. Maven project - pom.xml

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    
  2. Gradle project - build.gradle

    implementation 'org.springframework.boot:spring-boot-starter-security'
    

스프링 시큐리티의 의존성 추가 시 일어나는 일들

참고: 개발도중 매번 생성되는 랜덤문자열/계정으로 로그인하는것은 까다롭다. application.properties에 기본 name/password설정이 가능하다.

spring.security.user.name=user
spring.security.user.password=1234

문제점


사용자 정의 보안 기능 구현


스프링 시큐리티의 웹 보안 기능 초기화 및 설정 :WebSecurityConfigurerAdapter