Class JwtProperties

java.lang.Object
com.jerocaller.libs.spoonsuits.web.jwt.JwtProperties

@ConfigurationProperties(prefix="jwt") public class JwtProperties extends Object

application.properties(또는 .yml) 파일로부터 JWT 관련 설정값들을 가져오는 Spring bean.

application.yml 설정 예시

jwt:
 issuer: example@gmail.com
 secret-key: your-secret-key
 token:
   access:
     expiry: PT24H // (1일)
     cookie-name: ACCESS-TOKEN
   refresh:
     expiry: PT168H // (7일)
     cookie-name: REFRESH-TOKEN
 

기본값)

  • token.access.expiry: 1일
  • token.refresh.expiry: 7일
  • token.access.cookie-name: ACCESS-TOKEN
  • token.refresh.cookie-name: REFRESH-TOKEN

Note)

  • DefaultJwtAuthenticationProviderImpl에서 의존성 주입받아 사용할 클래스.
  • 생성자 바인딩 방식으로 구현하여 설정값들의 불변성 유지 가능.
  • application.yml의 expiry 값 형태는 Duration.toString 문서를 참고.
See Also:
  • Constructor Details

    • JwtProperties

      public JwtProperties()