본문 바로가기

반응형

spring boot

jasypt 라이브러리를 이용해 민감정보 숨기기 [Java, Spring Boot, jasypt] github에 프로젝트를 올리려고 했는데, 생각해보니 그대로 올리면 DB정보같은 게 200% 문제가 될 것 같았다. 그래서 어떻게든 DB관련 정보를 숨기기로 했다. 라이브러리 https://github.com/ulisesbocchio/jasypt-spring-boot ulisesbocchio/jasypt-spring-boot Jasypt integration for Spring boot. Contribute to ulisesbocchio/jasypt-spring-boot development by creating an account on GitHub. github.com http://www.jasypt.org/ Jasypt: Java simplified encryption - Jasypt: Java si.. 더보기
스프링 부트 스케쥴러 생성 [Java, Spring Boot, Scheduler] 서버를 실행하면 일정 시간/날짜 마다 실행되는 스케쥴러를 만들어보자 [프로젝트명]Application.java @SpringBootApplication @EnableConfigurationProperties(StorageProperties.class) //아래 어노테이션이 중요 @EnableScheduling public class 프로젝트명Application { //스케줄러 @Bean public TaskScheduler taskScheduler() { return new ConcurrentTaskScheduler(); } } /config/ConcurrentTaskScheduler.java @Component public class ConcurrentTaskScheduler { //자정마다 실행 (.. 더보기
로그인 성공, 실패 핸들러 작성 feat. 로그인 실패 시 alert 띄우기 [Java, Spring Security] config패키지의 SecurityConfig.java에 fromLogin() 을 이용하여 로그인에 관련된 부분을 다룰 수 있다. failureHandler와 successHandler로 실패 핸들러와 성공핸들러를 작성해보자 SecurityConfig.java @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .antMatchers("/", "/login").permitAll() //.antMatchers("/admin").hasRole("ADMIN") .antMatchers("/favicon.ico").permitAll() .anyRequest().authenticated() ... 더보기

반응형