티스토리 뷰
반응형
개발환경 | |
Os | Windows 10 |
IDE | STS 3.9.6 |
Jdk | 1.8.0_172 |
Spring | 5.2.1.RELEASE |
Spring Security | 4.2.13.RELEASE |
DB | MsSql |
View | JSP |
1. 프로젝트 최초 생성 / 구조
- New > Spring Legacy Project > SPring MVC Project
2. Spring Security 관련 추가 작업
1) 의존성 추가를 위해 POM.xml 에 Spring Security 4.2.2.RELEASE 추가
org.springframework.security spring-security-core 4.2.2.RELEASE jar compile org.springframework.security spring-security-web 4.2.2.RELEASE jar compile org.springframework.security spring-security-config 4.2.2.RELEASE jar compile org.springframework.security spring-security-taglibs 4.2.2.RELEASE jar compile
2) Web.xml 에 springSecurityFilterChain 등록 및 security-context.xml (신규파일) 등록
- DelegatingFilterProxy 로인해 모든 요청이 스프링시큐리티를 통해 인증 인가를 수행
contextConfigLocation /WEB-INF/spring/*-context.xml org.springframework.web.context.ContextLoaderListener springSecurityFilterChain org.springframework.web.filter.DelegatingFilterProxy springSecurityFilterChain /* appServlet org.springframework.web.servlet.DispatcherServlet contextConfigLocation /WEB-INF/spring/appServlet/servlet-context.xml 1 appServlet /
3) security 의 관련된 설정을 위한 security-context.xml 신규파일생성
- auto-config="true" 로 설정시 가장 기본적인 로그인페이지가 생성
- use-expressions : SPEL (spring express language) 사용여부
3. 적용 후 프로젝트 구조
- 빨간 점선으로 표시된 3개의 파일이 내용 변경 및 추가된 파일
4. 톰캣 구동후 화면
- localhost:8080/ 접속시 security-context.xml 에 /** 접근권한을 ORL_USER로 주었기에 /login 으로 이동
- 다른 정보로 접속시 실패 로그
- 로그인성공
깃허브 : https://github.com/devHjlee/SpringSecurity.git
커밋 : 8b078e6bea10d048ef4068f0c3aced7533c007e0
반응형
'Spring' 카테고리의 다른 글
Intellij Spring boot Jmx RMI remote objects have benn exported (0) | 2022.09.13 |
---|---|
Spring + Mssql + Mybatis 연동 (0) | 2019.12.03 |
Spring Security 구성하기(2) - 패턴구분 및 로그아웃 (0) | 2019.11.26 |
Spring Boot + Maven 웹프로젝트 시작하기_ application.properties 설정 (0) | 2018.10.01 |
Spring Boot + Maven 웹프로젝트 시작하기_프로젝트생성 (0) | 2018.09.21 |
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- cursor ai 프롬프트
- actuator prometheus grafana
- oubox pattern
- Enum Equals ==
- spring boot jpa crud
- Enum ==
- Spring boot Actuator
- custom Item writer
- Spring Actuator
- cursor ai crud
- cursor ai
- tomcat gzip
- spring security
- kafka oubox
- spring boot jpa
- cursorAI
- kafka redis
- quartz spring batch
- Enum equals
- no `meta.properties` found in
- kafka srping event
- cursor ai 프로젝트
- 스케줄링 시스템
- JdbcBatchItem
- quartz 실무 적용
- CompositeItemWriter
- 배치 관리 ui
- 배치 모니터링
- SpringBatch 5.1.1
- 잡 스케줄링
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
글 보관함