2022-05-17 TIL

이창호·2022년 5월 18일
0

SpringBoot Part5 - Spring Security

SecurityProperties

  • 왜 yaml이나 properties에는 하나의 유저만 설정 가능 할까??
spring:
  security:
    user:
      name: user
      password: 1234
      roles: USER
  • 그 이유는 SecurityProperties 클래스인데, 설정 파일에서 spring.security로 시작하는 녀석들을 바인딩하는 프로퍼티 클래스다.
  • 내부의 User 객체 필드가 하나 뿐이라 하나의 유저만 설정 가능 했던 것이다.

PasswordEncoder

  • PasswordEncoder는 인터페이스고 스프링 시큐리티5에선 구현체 중 하나인 DelegatingPasswordEncoder가 기본적으로 사용 된다.
  • 최초 1회 성공시 {noop} 타입에서, {bcrypt} 타입으로 변한다.
profile
이타적인 기회주의자

0개의 댓글