Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 751 Bytes

3. Users Microservice.md

File metadata and controls

17 lines (12 loc) · 751 Bytes

Spring Security

  • Authentication + Authorization
  • Step1: 애플리케이션에 Spring security jar을 Dependency에 추가
  • Step 2: WebSecurityConfigurerAdapter를 상속받는 Security Configuration 클래스 생성
  • Step 3: Security Configuration 클래스에 @EnableWebSecurity 추가
  • Step 4: Authentication → configure(AuthenticationManagerBuilder auth) 메서드 재정의
  • Step 5: Password encode를 위한 BCryptPasswordEncoder 빈 정의
  • Step 6: Authorization → configure(HttpSecurity http) 메서드를 재정의

Security

  • BCryptPasswordEncoder
    • Password를 해싱하기 위해 Bcrypt 알고리즘 사용
    • 랜덤 Salt를 부여하여 여러번 Hash를 적용한 암호화 방식