본문 바로가기

KNOWHOW

spring boot security custom login(2) + aop 지난 번 올렸던 스프링 부트 커스텀 로그인에 수정사항과 추가할 내용이 있어서 남김. 우선. WebSecurityConfigurerAdapter를 상속받아 구현한 configure 메소드의 내용 중.anyRequest().denyAll()로그인전이고 후고 나발이고 antMatchers에 맵핑되어 있지 않은 url은 그냥 아예 모두 허용하지 않는다는 구문이다. 로그인시에는 허용, 비로그인시에는 불허 하려면.anyRequest().authenticated() 로 수정해야 한다. 그리고 이전에는 내 User 빈이 아닌 org.springframework.security.core.userdetails.User(user.getEmail(), user.getPassword(), authories);로 리턴을 했었다... 더보기
spring boot security custom login A. spring security 커스텀 설정을 위해서는 WebSecurityConfigurerAdapter를 상속 받은 Configuration을 구현해야 한다.configure 메소드들을 override해서 custom 환경을 셋팅한다.1. configure(WebSecurity web) : web.ignoring().antMatchers("/resources/**");// 내 경우 webapp/resources 에 css, js, image 파일들을 모아놓았고 jsp 파일은 webapp/WEB-INF/view/에 모아놓았다. 2. configure(HttpSecurity http) : ....antMatchers(...).permitAll() // matcher된 경로들은 모두 허용.anyReque.. 더보기
spring boot tiles 적용 spring boot에 tiles를 붙이던 중 뭔 짓을 해도 controller에서 return하는 jsp가 바로 맵핑되어 tiles.xml에 적용된 레이아웃이 적용이 안됐다.tiles config 파일에 viewResolver에 order 값을 줬더니 동작. - application.properties # set view spring.mvc.view.prefix=/WEB-INF/jsp/ spring.mvc.view.suffix=.jsp - TilesConfig.java @Bean(name="viewResolver") public TilesViewResolver tilesViewResolver() { TilesViewResolver resolver = new TilesViewResolver(); reso.. 더보기
centos7 ssh port 변경 sshd_config 수정 및 서비스 재기동.1. sshd_config 수정 : #Port 22 부분 찾아서 원하는 포트로 수정 후 저장 [vi /etc/ssh/sshd_config]2. ssh서비스 재기동 [systemctl restart sshd] status로 확인해보라는 뻔한 메시지만 남겨두고는 실패. Job for sshd.service failed because the control process exited with error code. See "systemctl status sshd.service" and "journalctl -xe" for details. sshd_config을 먼저 수정하고 재기동 한 후에 semanage나 firewall-cmd에 포트를 수정하려 했으나첫 번째 단계에.. 더보기
리눅스 노트북 덮개와 무관하게 전원 유지 /etc/systemd/logind.conf 파일을 vi 편집기로 열고 #HandleLidSwitch=suspend 주석되어 있는 부분을 풀고 suspend -> ignore로 수정 HandleLidSwitch=ignore 재부팅 참고) https://www.unix.com/man-page/centos/5/logind.conf/ 더보기