일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- docker compose mysql
- Selenium
- ChannelPipeline
- cassandra
- Redis Sentinel
- Docker Compose
- MySQL
- QueryDSL
- redis
- jmeter
- weblogic 10
- docker-compose
- spring boot
- spring boot redis
- docker
- vue.js
- JPA
- WebLogic
- Airflow
- argo cd
- grafana
- netflix oss
- KAFKA
- spring cloud
- Netty
- Hibernate
- mybatis
- Spring Open Feign
- RabbitMQ
- coalesce
- Today
- Total
IT.FARMER
Spring security Session name 은 어느곳에? 본문
스프링 시큐리티를 사용하여 로그인 모듈생성시, 시큐리티에서는 세션 이름을 무엇으로 만들까 확인하고 싶다.
실제 세션을 만들어주는 SecurityContextPersistenceFilter 필터 안에 HttpSessionSecurityContextRepository 에 들어 있다.
좀더 자세한 필터 내역을 확인 하시려면, 필터도 여러개가 있고, 각 동작하는 필터마다 의미가 다르기때문에 필터에 관한 내역으로 검색해 보길 권합니다.
/////////////////////////////////////////////////////////////////////////
// 세션 상세 정보 확인
/////////////////////////////////////////////////////////////////////////
HttpSession session = request.getSession();
Enumeration<?> attributeNames = session.getAttributeNames();
while (attributeNames.hasMoreElements()) {
String name = (String) attributeNames.nextElement();
if (name.equals("SPRING_SECURITY_CONTEXT")) {
SecurityContext value = (SecurityContext) session.getAttribute(name);
Authentication authentication = value.getAuthentication();
User principal = (User) authentication.getPrincipal();
WebAuthenticationDetails details = (WebAuthenticationDetails) authentication.getDetails();
String username = authentication.getName();
String password = (String) authentication.getCredentials();
logger.debug(" \n\n\n ");
logger.debug("///////////////////////////////////////////////////////////////////");
logger.debug("////////////////////SPRING_SECURITY_CONTEXT ///////////////////////");
logger.debug("///////////////////////////////////////////////////////////////////");
logger.debug("name = " + name + " , value = " + value.toString());
logger.debug("authentication : " + authentication.toString());
logger.debug("principal : " + principal);
logger.debug("details : " + details.toString());
logger.debug("username : " + username);
logger.debug("password : " + password);
logger.debug(" \n\n\n ");
}
}
'Spring > Spring Security' 카테고리의 다른 글
Spring Security 동적 권한 할당 (0) | 2016.10.19 |
---|---|
Spring Security logout Handler custom (0) | 2014.11.14 |
Spring Security Session 제어 (0) | 2014.11.06 |
Spring Security CSRF / filter / muiltipart-form (6) | 2014.11.06 |