소스 동기화
This commit is contained in:
commit
2da88cb91a
23
pom.xml
23
pom.xml
@ -142,6 +142,18 @@
|
|||||||
<version>3.1</version>
|
<version>3.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-core</artifactId>
|
||||||
|
<version>${spring.maven.artifact.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-expression</artifactId>
|
||||||
|
<version>${spring.maven.artifact.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- fileupload -->
|
<!-- fileupload -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-fileupload</groupId>
|
<groupId>commons-fileupload</groupId>
|
||||||
@ -155,8 +167,17 @@
|
|||||||
</exclusions> -->
|
</exclusions> -->
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- Spring Security -->
|
<!-- Spring Security -->
|
||||||
|
<!-- <dependency>
|
||||||
|
<groupId>org.springframework.webflow</groupId>
|
||||||
|
<artifactId>spring-webflow</artifactId>
|
||||||
|
<version>2.5.0.RELEASE</version>
|
||||||
|
</dependency> -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.webflow</groupId>
|
||||||
|
<artifactId>spring-faces</artifactId>
|
||||||
|
<version>2.4.1.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.security</groupId>
|
<groupId>org.springframework.security</groupId>
|
||||||
<artifactId>spring-security-web</artifactId>
|
<artifactId>spring-security-web</artifactId>
|
||||||
|
|||||||
@ -20,7 +20,9 @@ public class OAuthLogin {
|
|||||||
private OAuth20Service oauthService;
|
private OAuth20Service oauthService;
|
||||||
private OAuthVO oauthVO;
|
private OAuthVO oauthVO;
|
||||||
|
|
||||||
|
|
||||||
public OAuthLogin(OAuthVO oauthVO) {
|
public OAuthLogin(OAuthVO oauthVO) {
|
||||||
|
|
||||||
this.oauthService = new ServiceBuilder(oauthVO.getClientId())
|
this.oauthService = new ServiceBuilder(oauthVO.getClientId())
|
||||||
.apiSecret(oauthVO.getClientSecret())
|
.apiSecret(oauthVO.getClientSecret())
|
||||||
.callback(oauthVO.getRedirectUrl())
|
.callback(oauthVO.getRedirectUrl())
|
||||||
@ -30,6 +32,17 @@ public class OAuthLogin {
|
|||||||
this.oauthVO = oauthVO;
|
this.oauthVO = oauthVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public OAuthLogin(OAuthVO oauthVO, String deptJsessionId) {
|
||||||
|
|
||||||
|
this.oauthService = new ServiceBuilder(oauthVO.getClientId())
|
||||||
|
.apiSecret(oauthVO.getClientSecret())
|
||||||
|
.callback(appendParam(oauthVO.getRedirectUrl(), "deptJsessionId", deptJsessionId))
|
||||||
|
.scope("profile")
|
||||||
|
.build(oauthVO.getApi20Instance());
|
||||||
|
|
||||||
|
this.oauthVO = oauthVO;
|
||||||
|
}
|
||||||
|
|
||||||
public String getOAuthURL() {
|
public String getOAuthURL() {
|
||||||
return this.oauthService.getAuthorizationUrl();
|
return this.oauthService.getAuthorizationUrl();
|
||||||
}
|
}
|
||||||
@ -100,6 +113,9 @@ public class OAuthLogin {
|
|||||||
// 성별
|
// 성별
|
||||||
user.setGender(resNode.get("gender").asText());
|
user.setGender(resNode.get("gender").asText());
|
||||||
|
|
||||||
|
// 로그인 성공
|
||||||
|
user.setValidLogin(true);
|
||||||
|
|
||||||
} else if (this.oauthVO.isKakao()) {
|
} else if (this.oauthVO.isKakao()) {
|
||||||
user.setServiceName(OAuthConfig.KAKAO_SERVICE_NAME);
|
user.setServiceName(OAuthConfig.KAKAO_SERVICE_NAME);
|
||||||
JsonNode resNode = rootNode.get("properties");
|
JsonNode resNode = rootNode.get("properties");
|
||||||
@ -110,4 +126,18 @@ public class OAuthLogin {
|
|||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String appendParam(String url, String paramName, String paramValue) {
|
||||||
|
if(StringUtil.isEmpty(url)) return "";
|
||||||
|
if(StringUtil.isEmpty(paramName)) return url;
|
||||||
|
|
||||||
|
if(StringUtil.isEmpty(paramValue)) paramValue = "";
|
||||||
|
|
||||||
|
if(url.contains("?")) url += "&";
|
||||||
|
else url += "?";
|
||||||
|
|
||||||
|
url += paramName + "=" + paramValue;
|
||||||
|
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@ public class OAuthUniversalUser {
|
|||||||
|
|
||||||
private String loginIp;
|
private String loginIp;
|
||||||
private Date lastLogin;
|
private Date lastLogin;
|
||||||
|
private boolean isValidLogin = false;
|
||||||
|
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
return StringUtil.isNotEmpty(uid) && StringUtil.isNotEmpty(userId);
|
return StringUtil.isNotEmpty(uid) && StringUtil.isNotEmpty(userId);
|
||||||
@ -121,4 +122,12 @@ public class OAuthUniversalUser {
|
|||||||
this.gender = gender;
|
this.gender = gender;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isValidLogin() {
|
||||||
|
return isValidLogin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValidLogin(boolean isValidLogin) {
|
||||||
|
this.isValidLogin = isValidLogin;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -149,7 +149,6 @@ public class QRCodeUtil {
|
|||||||
// (2) 앞의 (1)의 문자열을 암호화 처리
|
// (2) 앞의 (1)의 문자열을 암호화 처리
|
||||||
String cryptedBarcodeText = EgovFileScrty.encodeBinary(barcodeText.getBytes());
|
String cryptedBarcodeText = EgovFileScrty.encodeBinary(barcodeText.getBytes());
|
||||||
log.debug("generateMemberQRCodeImage : cryptedBarcodeText=" + cryptedBarcodeText);
|
log.debug("generateMemberQRCodeImage : cryptedBarcodeText=" + cryptedBarcodeText);
|
||||||
loginVO.setOnnaraUserid(cryptedBarcodeText); // TODO 임시저장처리 DDDDDDDDDDDDDDDDDDDDDDD
|
|
||||||
|
|
||||||
// (3) 앞의 (2) 암호화 문자열로 QRCode 생성하여 BufferedImage형식으로 리턴
|
// (3) 앞의 (2) 암호화 문자열로 QRCode 생성하여 BufferedImage형식으로 리턴
|
||||||
return generateQRCodeImageByZxing(cryptedBarcodeText);
|
return generateQRCodeImageByZxing(cryptedBarcodeText);
|
||||||
|
|||||||
@ -109,7 +109,10 @@ public class NlibProperty {
|
|||||||
if(loadProperties() < 0) return null;
|
if(loadProperties() < 0) return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return properties.getProperty(name);
|
String value = properties.getProperty(name);
|
||||||
|
if(value != null) value = value.trim();
|
||||||
|
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
72
src/main/java/nlib/cmm/session/SessionConfig.java
Normal file
72
src/main/java/nlib/cmm/session/SessionConfig.java
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
package nlib.cmm.session;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
import javax.servlet.annotation.WebListener;
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
import javax.servlet.http.HttpSessionEvent;
|
||||||
|
import javax.servlet.http.HttpSessionListener;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.security.core.context.SecurityContext;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
|
||||||
|
import nlib.user.service.impl.LoginServiceImpl;
|
||||||
|
import nlib.util.StringUtil;
|
||||||
|
|
||||||
|
@WebListener
|
||||||
|
public class SessionConfig implements HttpSessionListener {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(LoginServiceImpl.class);
|
||||||
|
|
||||||
|
private static final Map<String, String> sessions = new ConcurrentHashMap<>();
|
||||||
|
//
|
||||||
|
// //중복로그인 지우기
|
||||||
|
// public synchronized static String getSessionidCheck(String type, String compareId){
|
||||||
|
// String result = "";
|
||||||
|
// for( String key : sessions.keySet() ){
|
||||||
|
// HttpSession hs = sessions.get(key);
|
||||||
|
// if(hs != null && hs.getAttribute(type) != null && hs.getAttribute(type).toString().equals(compareId) ){
|
||||||
|
// result = key.toString();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// removeSessionForDoubleLogin(result);
|
||||||
|
// return result;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private static void removeSessionForDoubleLogin(String userId){
|
||||||
|
// System.out.println("remove userId : " + userId);
|
||||||
|
// if(userId != null && userId.length() > 0){
|
||||||
|
// sessions.get(userId).invalidate();
|
||||||
|
// sessions.remove(userId);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sessionCreated(HttpSessionEvent se) {
|
||||||
|
System.out.println("Session sessionCreated (O) : " + se.getSession().getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sessionDestroyed(HttpSessionEvent se) {
|
||||||
|
log.debug("Session sessionDestroyed (X) : " + se.getSession().getId());
|
||||||
|
if(sessions.get(se.getSession().getId()) != null){
|
||||||
|
//sessions.get(se.getSession().getId()).invalidate();
|
||||||
|
sessions.remove(se.getSession().getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getLoginInfo(String sessionId) {
|
||||||
|
if(StringUtil.isEmpty(sessionId)) return null;
|
||||||
|
|
||||||
|
return sessions.get(sessionId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setLoginInfo(String sessionId, String snsUserId) {
|
||||||
|
sessions.put(sessionId, snsUserId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -7,9 +7,7 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import egovframework.rte.psl.dataaccess.EgovAbstractMapper;
|
import egovframework.com.cmm.service.impl.EgovComAbstractDAO;
|
||||||
import nlib.restful.service.DataApiReqVO;
|
|
||||||
import nlib.restful.service.DataApiResVO;
|
|
||||||
import nlib.util.StringUtil;
|
import nlib.util.StringUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -36,30 +34,30 @@ import nlib.util.StringUtil;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Repository("secUserDAO")
|
@Repository("secUserDAO")
|
||||||
public class SecUserDAO extends EgovAbstractMapper {
|
public class SecUserDAO extends EgovComAbstractDAO {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(SecUserDAO.class);
|
private static final Logger log = LoggerFactory.getLogger(SecUserDAO.class);
|
||||||
|
|
||||||
public SecUserVO loadUserByUsername(String userName) {
|
public SecUserVO loadUserByUsername(String loginUserId) {
|
||||||
|
|
||||||
HashMap<String, String> info = selectOne("secUserDAO.loadUserByUsername", userName);
|
SecUserVO uInfo = (SecUserVO)selectOne("SecUserDAO.loadUserByUsername", loginUserId);
|
||||||
|
|
||||||
// 사용자 정보 담기
|
if(uInfo == null) {
|
||||||
SecUserVO ret = new SecUserVO();
|
uInfo = new SecUserVO();
|
||||||
ret.setUserId ((String)info.get("userId"));
|
} else {
|
||||||
ret.setUserNm ((String)info.get("userName"));
|
// 다중 권한 설정
|
||||||
ret.setUserPwd ((String)info.get("userPwd"));
|
String authorities = (String)uInfo.getAuthorityList();
|
||||||
ret.setLoginUserId ((String)info.get("loginUserId"));
|
if(StringUtil.isEmpty(authorities)) {
|
||||||
|
uInfo.addAuthority(SecUserVO.DEFAULT_ROLE);
|
||||||
// 다중 권한 설정
|
} else {
|
||||||
String authorities = (String)info.get("authorities");
|
String[] authArr = authorities.split(",");
|
||||||
if(StringUtil.isEmpty(authorities)) ret.addAuthority(SecUserVO.DEFAULT_ROLE);
|
for(String auth : authArr) {
|
||||||
else {
|
uInfo.addAuthority(auth);
|
||||||
String[] authArr = authorities.split(",");
|
}
|
||||||
Arrays.stream(authArr).forEach(auth -> ret.addAuthority(auth));
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return uInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,12 +52,12 @@ public class SecUserDetailsService implements UserDetailsService {
|
|||||||
* @see org.springframework.security.core.userdetails.UserDetailsService#loadUserByUsername(java.lang.String)
|
* @see org.springframework.security.core.userdetails.UserDetailsService#loadUserByUsername(java.lang.String)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
public UserDetails loadUserByUsername(String loginUserId) throws UsernameNotFoundException {
|
||||||
|
|
||||||
SecUserVO secUserVO = secUserDAO.loadUserByUsername(username);
|
SecUserVO secUserVO = secUserDAO.loadUserByUsername(loginUserId);
|
||||||
|
|
||||||
if(secUserVO == null) {
|
if(secUserVO == null) {
|
||||||
throw new UsernameNotFoundException(username);
|
throw new UsernameNotFoundException(loginUserId);
|
||||||
}
|
}
|
||||||
return secUserVO;
|
return secUserVO;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import org.springframework.security.core.GrantedAuthority;
|
|||||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||||
import org.springframework.security.core.userdetails.UserDetails;
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
|
|
||||||
|
import nlib.cmm.service.NlibProperty;
|
||||||
import nlib.user.service.NlibLoginVO;
|
import nlib.user.service.NlibLoginVO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -35,8 +36,12 @@ public class SecUserVO extends NlibLoginVO implements UserDetails {
|
|||||||
|
|
||||||
private static final long serialVersionUID = -8274004534207618048L;
|
private static final long serialVersionUID = -8274004534207618048L;
|
||||||
|
|
||||||
public static final String ROLE_USER = "ROLE_USER";
|
/* 권한 ROLE 명칭 */
|
||||||
public static final String ROLE_ADMIN = "ROLE_ADMIN";
|
public static final String ROLE_USER = NlibProperty.getString("auth.role.user"); // 일반사용자
|
||||||
|
public static final String ROLE_ADMIN = NlibProperty.getString("auth.role.admin"); // 관리자
|
||||||
|
public static final String ROLE_SYSTEM = NlibProperty.getString("auth.role.system"); // 시스템관리자
|
||||||
|
|
||||||
|
/* 기본권한 ROLE */
|
||||||
public static final String DEFAULT_ROLE = ROLE_USER;
|
public static final String DEFAULT_ROLE = ROLE_USER;
|
||||||
|
|
||||||
ArrayList<GrantedAuthority> auth = null; /* 권한 목록 */
|
ArrayList<GrantedAuthority> auth = null; /* 권한 목록 */
|
||||||
|
|||||||
@ -45,6 +45,8 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void configure(WebSecurity web) throws Exception {
|
public void configure(WebSecurity web) throws Exception {
|
||||||
|
|
||||||
|
// 권한/인증과 무관한 오픈된 정적 리소트
|
||||||
web.ignoring()
|
web.ignoring()
|
||||||
.antMatchers("/resources/**")
|
.antMatchers("/resources/**")
|
||||||
.antMatchers("/css/**")
|
.antMatchers("/css/**")
|
||||||
@ -52,13 +54,6 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
.antMatchers("/js/**")
|
.antMatchers("/js/**")
|
||||||
.antMatchers("/temp/**")
|
.antMatchers("/temp/**")
|
||||||
.antMatchers("/favicon/**")
|
.antMatchers("/favicon/**")
|
||||||
.antMatchers("/*/*Ajax.do")
|
|
||||||
.antMatchers("/fileupload/**")
|
|
||||||
.antMatchers("/board/**")
|
|
||||||
.antMatchers("/inform/**")
|
|
||||||
.antMatchers("/alert/**")
|
|
||||||
.antMatchers("/code/**")
|
|
||||||
.antMatchers("/**")
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,6 +77,14 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
.antMatchers("/rent/*.do").permitAll()
|
.antMatchers("/rent/*.do").permitAll()
|
||||||
.antMatchers("/collection/*.do").permitAll()
|
.antMatchers("/collection/*.do").permitAll()
|
||||||
.antMatchers("/sample/password/getSampleEncoder.do").permitAll()
|
.antMatchers("/sample/password/getSampleEncoder.do").permitAll()
|
||||||
|
.antMatchers("/*/*Ajax.do").permitAll()
|
||||||
|
.antMatchers("/fileupload/**").permitAll()
|
||||||
|
.antMatchers("/board/**").permitAll()
|
||||||
|
.antMatchers("/inform/**").permitAll()
|
||||||
|
.antMatchers("/alert/**").permitAll()
|
||||||
|
.antMatchers("/code/**").permitAll()
|
||||||
|
.antMatchers("/homes/**").permitAll()
|
||||||
|
.antMatchers("/homes/**").permitAll()
|
||||||
.anyRequest().authenticated()
|
.anyRequest().authenticated()
|
||||||
.and().formLogin()
|
.and().formLogin()
|
||||||
.loginPage("/login/loginForm.do")
|
.loginPage("/login/loginForm.do")
|
||||||
|
|||||||
@ -10,7 +10,11 @@ public interface LoginService
|
|||||||
{
|
{
|
||||||
public String login(HttpServletRequest req, String username, String password);
|
public String login(HttpServletRequest req, String username, String password);
|
||||||
|
|
||||||
public String loginOauth(String snsUid);
|
public String loginOauth(HttpServletRequest req, String snsUserId, String deptJsessionId);
|
||||||
|
|
||||||
|
public String loginDeptSSO(HttpServletRequest req, String snsUserId);
|
||||||
|
|
||||||
|
public String loginDept(HttpServletRequest req, String snsUserId);
|
||||||
|
|
||||||
public DataApiResVO logout(DataApiReqVO reqVO);
|
public DataApiResVO logout(DataApiReqVO reqVO);
|
||||||
|
|
||||||
|
|||||||
@ -35,41 +35,28 @@ public class NlibLoginVO implements Serializable {
|
|||||||
private String userId; /* 사용자아이디 (ex: U1000000001) */
|
private String userId; /* 사용자아이디 (ex: U1000000001) */
|
||||||
private String loginUserId; /* 로그인사용자ID (이메일주소) */
|
private String loginUserId; /* 로그인사용자ID (이메일주소) */
|
||||||
private String deptSeq; /* 조직코드 */
|
private String deptSeq; /* 조직코드 */
|
||||||
private String userDiv; /* 사용자구분 */
|
private String deptNm; /* 조직명 */
|
||||||
private String userNm; /* 사용자명 */
|
private String userNm; /* 사용자명 */
|
||||||
private String userPwd; /* 비밀번호 */
|
private String userPwd; /* 비밀번호 */
|
||||||
private String posNm; /* 직위 */
|
|
||||||
private String rank; /* 직급 */
|
|
||||||
private String workFlag; /* 근무여부 */
|
|
||||||
private String telNo; /* 전화번호 */
|
private String telNo; /* 전화번호 */
|
||||||
private String zipcode; /* 우편번호 (변경예정) */
|
private String zipcode; /* 우편번호 (변경예정) */
|
||||||
private String addr1; /* 주소1 (변경예정) */
|
private String addr1; /* 주소1 (변경예정) */
|
||||||
private String addr2; /* 주소2 (변경예정) */
|
private String addr2; /* 주소2 (변경예정) */
|
||||||
private String strtMenuSeq; /* 시작페이지 */
|
private String status; /* 상태 : S정상, D탈퇴, P휴면 */
|
||||||
private String idCardChkYn; /* 신분증 확인여부 */
|
|
||||||
private String useYn; /* 사용여부 */
|
|
||||||
private String ssoFlag; /* 시스템구분(1:기록관리,2:기관배치) */
|
|
||||||
private String loginErrorCnt; /* 로그인오류건수 */
|
|
||||||
private String onnaraUserid; /* 온나라사용자아이디(웹서비스용) */
|
|
||||||
private String pkiNameCheck; /* 인증서 등록시 이름 체크 구분 */
|
|
||||||
private String ssoKey; /* SSO 인증KEY (SSO를 위한 사용자의 KEY값) */
|
|
||||||
private String regId; /* 등록자 */
|
private String regId; /* 등록자 */
|
||||||
private String regDd; /* 등록일자 */
|
private String regDd; /* 등록일자 */
|
||||||
private String modId; /* 수정자 */
|
private String modId; /* 수정자 */
|
||||||
private String modDd; /* 수정일자 */
|
private String modDd; /* 수정일자 */
|
||||||
private String email; /* 이메일 */
|
private String email; /* 이메일 */
|
||||||
private String mobileNo; /* 모바일 */
|
private String mobileNo; /* 모바일 */
|
||||||
private String websiteAddr; /* 웹사이트 */
|
|
||||||
private String facebookId; /* 페이스북아이디 */
|
|
||||||
private String twitterId; /* 트위터아이디 */
|
|
||||||
private String googleId; /* 구글플러스아이디 */
|
|
||||||
private String boardRowCnt; /* 글목록수 */
|
|
||||||
|
|
||||||
private String birthdate; /* 생년월일 */
|
private String birthdate; /* 생년월일 */
|
||||||
private String gender; /* 성별(M:남자,F:여자) */
|
private String gender; /* 성별(M:남자,F:여자) */
|
||||||
|
|
||||||
private String authKey; /* 로그인 인증키 */
|
private String authKey; /* 로그인 인증키 */
|
||||||
|
private String loginSucsYn; /* 로그인성공여부 */
|
||||||
|
private String accIp; /* 접속IP */
|
||||||
|
private String authorityList; /* 권한ROLE 리스트 */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 로그인인증키값을 리턴한다. 만일 존재하지 않을 경우, userId를 기반으로 인증키를 생성하여 리턴한다.
|
* 로그인인증키값을 리턴한다. 만일 존재하지 않을 경우, userId를 기반으로 인증키를 생성하여 리턴한다.
|
||||||
@ -95,9 +82,11 @@ public class NlibLoginVO implements Serializable {
|
|||||||
return this.authKey;
|
return this.authKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
// SETTER.GETTER
|
// SETTER.GETTER
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
|
||||||
public String getUserId() {
|
public String getUserId() {
|
||||||
return userId;
|
return userId;
|
||||||
}
|
}
|
||||||
@ -122,18 +111,22 @@ public class NlibLoginVO implements Serializable {
|
|||||||
this.deptSeq = deptSeq;
|
this.deptSeq = deptSeq;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserDiv() {
|
public String getDeptNm() {
|
||||||
return userDiv;
|
return deptNm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserDiv(String userDiv) {
|
public void setDeptNm(String deptNm) {
|
||||||
this.userDiv = userDiv;
|
this.deptNm = deptNm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUserNm() {
|
public String getUserNm() {
|
||||||
return userNm;
|
return userNm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return userNm;
|
||||||
|
}
|
||||||
|
|
||||||
public void setUserNm(String userNm) {
|
public void setUserNm(String userNm) {
|
||||||
this.userNm = userNm;
|
this.userNm = userNm;
|
||||||
}
|
}
|
||||||
@ -146,30 +139,6 @@ public class NlibLoginVO implements Serializable {
|
|||||||
this.userPwd = userPwd;
|
this.userPwd = userPwd;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPosNm() {
|
|
||||||
return posNm;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPosNm(String posNm) {
|
|
||||||
this.posNm = posNm;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRank() {
|
|
||||||
return rank;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRank(String rank) {
|
|
||||||
this.rank = rank;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getWorkFlag() {
|
|
||||||
return workFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWorkFlag(String workFlag) {
|
|
||||||
this.workFlag = workFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTelNo() {
|
public String getTelNo() {
|
||||||
return telNo;
|
return telNo;
|
||||||
}
|
}
|
||||||
@ -202,68 +171,12 @@ public class NlibLoginVO implements Serializable {
|
|||||||
this.addr2 = addr2;
|
this.addr2 = addr2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getStrtMenuSeq() {
|
public String getStatus() {
|
||||||
return strtMenuSeq;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStrtMenuSeq(String strtMenuSeq) {
|
public void setStatus(String status) {
|
||||||
this.strtMenuSeq = strtMenuSeq;
|
this.status = status;
|
||||||
}
|
|
||||||
|
|
||||||
public String getIdCardChkYn() {
|
|
||||||
return idCardChkYn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIdCardChkYn(String idCardChkYn) {
|
|
||||||
this.idCardChkYn = idCardChkYn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUseYn() {
|
|
||||||
return useYn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseYn(String useYn) {
|
|
||||||
this.useYn = useYn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSsoFlag() {
|
|
||||||
return ssoFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSsoFlag(String ssoFlag) {
|
|
||||||
this.ssoFlag = ssoFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLoginErrorCnt() {
|
|
||||||
return loginErrorCnt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLoginErrorCnt(String loginErrorCnt) {
|
|
||||||
this.loginErrorCnt = loginErrorCnt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOnnaraUserid() {
|
|
||||||
return onnaraUserid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOnnaraUserid(String onnaraUserid) {
|
|
||||||
this.onnaraUserid = onnaraUserid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPkiNameCheck() {
|
|
||||||
return pkiNameCheck;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPkiNameCheck(String pkiNameCheck) {
|
|
||||||
this.pkiNameCheck = pkiNameCheck;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSsoKey() {
|
|
||||||
return ssoKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSsoKey(String ssoKey) {
|
|
||||||
this.ssoKey = ssoKey;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRegId() {
|
public String getRegId() {
|
||||||
@ -314,55 +227,6 @@ public class NlibLoginVO implements Serializable {
|
|||||||
this.mobileNo = mobileNo;
|
this.mobileNo = mobileNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getWebsiteAddr() {
|
|
||||||
return websiteAddr;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWebsiteAddr(String websiteAddr) {
|
|
||||||
this.websiteAddr = websiteAddr;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFacebookId() {
|
|
||||||
return facebookId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFacebookId(String facebookId) {
|
|
||||||
this.facebookId = facebookId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTwitterId() {
|
|
||||||
return twitterId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTwitterId(String twitterId) {
|
|
||||||
this.twitterId = twitterId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getGoogleId() {
|
|
||||||
return googleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGoogleId(String googleId) {
|
|
||||||
this.googleId = googleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBoardRowCnt() {
|
|
||||||
return boardRowCnt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBoardRowCnt(String boardRowCnt) {
|
|
||||||
this.boardRowCnt = boardRowCnt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAuthKey() {
|
|
||||||
|
|
||||||
return authKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAuthKey(String authKey) {
|
|
||||||
this.authKey = authKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBirthdate() {
|
public String getBirthdate() {
|
||||||
return birthdate;
|
return birthdate;
|
||||||
}
|
}
|
||||||
@ -379,4 +243,36 @@ public class NlibLoginVO implements Serializable {
|
|||||||
this.gender = gender;
|
this.gender = gender;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getAuthKey() {
|
||||||
|
return authKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthKey(String authKey) {
|
||||||
|
this.authKey = authKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLoginSucsYn() {
|
||||||
|
return loginSucsYn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoginSucsYn(String loginSucsYn) {
|
||||||
|
this.loginSucsYn = loginSucsYn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAccIp() {
|
||||||
|
return accIp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccIp(String accIp) {
|
||||||
|
this.accIp = accIp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuthorityList() {
|
||||||
|
return authorityList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthorityList(String authorityList) {
|
||||||
|
this.authorityList = authorityList;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,12 +3,14 @@ package nlib.user.service.impl;
|
|||||||
|
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import egovframework.com.cmm.service.impl.EgovComAbstractDAO;
|
||||||
import nlib.restful.service.DataApiReqVO;
|
import nlib.restful.service.DataApiReqVO;
|
||||||
import nlib.restful.service.DataApiResVO;
|
import nlib.restful.service.DataApiResVO;
|
||||||
|
import nlib.user.service.NlibLoginVO;
|
||||||
|
|
||||||
@Repository("loginDAO")
|
@Repository("loginDAO")
|
||||||
public class LoginDAO
|
public class LoginDAO extends EgovComAbstractDAO {
|
||||||
{
|
|
||||||
public DataApiResVO login(DataApiReqVO reqVO) {
|
public DataApiResVO login(DataApiReqVO reqVO) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -17,5 +19,12 @@ public class LoginDAO
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NlibLoginVO selectLoginUserInfo(String snsUserId) {
|
||||||
|
return (NlibLoginVO) selectOne("LoginDAO.selectLoginUserInfo", snsUserId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insertLoginLog(NlibLoginVO userVO) {
|
||||||
|
insert("LoginDAO.insertLoginLog", userVO);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -13,13 +13,16 @@ import org.springframework.security.authentication.DisabledException;
|
|||||||
import org.springframework.security.authentication.LockedException;
|
import org.springframework.security.authentication.LockedException;
|
||||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
|
import org.springframework.security.core.context.SecurityContext;
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import nlib.cmm.session.SessionConfig;
|
||||||
import nlib.restful.service.DataApiReqVO;
|
import nlib.restful.service.DataApiReqVO;
|
||||||
import nlib.restful.service.DataApiResVO;
|
import nlib.restful.service.DataApiResVO;
|
||||||
import nlib.security.SecUserVO;
|
import nlib.security.SecUserVO;
|
||||||
import nlib.user.service.LoginService;
|
import nlib.user.service.LoginService;
|
||||||
|
import nlib.user.service.NlibLoginVO;
|
||||||
import nlib.util.StringUtil;
|
import nlib.util.StringUtil;
|
||||||
|
|
||||||
@Service("loginService")
|
@Service("loginService")
|
||||||
@ -72,17 +75,25 @@ public class LoginServiceImpl implements LoginService
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/* SNS 연동 SSO를 통한 로그인 처리한다.
|
||||||
* SNS 연동을 통한 로그인 처리를 수행한다.
|
*
|
||||||
|
* return값이 null인 경우, 정상적인 로그인 처리 완료
|
||||||
|
* null이 아닌 경우, REDIRECT되어야 하는 URL(오류 코드 포함)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public String loginOauth(String snsUid) {
|
// public String loginOauth(HttpServletRequest req, String snsUserId) {
|
||||||
|
//
|
||||||
// SNS 연동 사용자UID로 사용자정보 조회
|
// // SNS 연동 사용자UID로 사용자정보 조회
|
||||||
if(StringUtil.isEmpty(snsUid)) return null;
|
// if(StringUtil.isEmpty(snsUserId)) return "/login/loginForm.do?error=req-sns-sso";
|
||||||
|
//
|
||||||
|
// NlibLoginVO nLoginVO = loginDAO.selectLoginUserInfo(snsUserId);
|
||||||
|
//
|
||||||
|
// if(nLoginVO == null) {
|
||||||
|
// return "/login/loginForm.do?error=new-membership";
|
||||||
|
// }
|
||||||
|
//
|
||||||
// // 아이디와 패스워드로, Security 가 알아 볼 수 있는 token 객체로 변경한다.
|
// // 아이디와 패스워드로, Security 가 알아 볼 수 있는 token 객체로 변경한다.
|
||||||
// UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(username, password);
|
// UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(nLoginVO.getLoginUserId(), nLoginVO.getUserPwd());
|
||||||
//
|
//
|
||||||
// try {
|
// try {
|
||||||
// // AuthenticationManager 에 token 을 넘기면 UserDetailsService 가 받아 처리하도록 한다.
|
// // AuthenticationManager 에 token 을 넘기면 UserDetailsService 가 받아 처리하도록 한다.
|
||||||
@ -90,22 +101,179 @@ public class LoginServiceImpl implements LoginService
|
|||||||
//
|
//
|
||||||
// // AuthKey 등록
|
// // AuthKey 등록
|
||||||
// SecUserVO userVO = (SecUserVO)authentication.getPrincipal();
|
// SecUserVO userVO = (SecUserVO)authentication.getPrincipal();
|
||||||
// userVO.setAuthKey(req.getSession().getId()); // TODO : 임시로 세션ID 넣음, 실제 Authkey 생성 규칙에 따른 해당 키 설정 처리 필요
|
// userVO.getAndCreateAuthKey(req.getSession().getId()); // SET AUTHKEY
|
||||||
//
|
//
|
||||||
// // 실제 SecurityContext 에 authentication 정보를 등록한다.
|
// // 실제 SecurityContext 에 authentication 정보를 등록한다.
|
||||||
// SecurityContextHolder.getContext().setAuthentication(authentication);
|
// SecurityContextHolder.getContext().setAuthentication(authentication);
|
||||||
//
|
//
|
||||||
// // TODO : 로그인 로그 정보를 통합자료시스템에 전송한다.
|
// // TODO : 로그인 로그 정보를 통합자료시스템에 전송한다.
|
||||||
|
// userVO.setAccIp(req.getRemoteAddr());
|
||||||
|
// userVO.setLoginSucsYn("Y");
|
||||||
|
// loginDAO.insertLoginLog(userVO);
|
||||||
//
|
//
|
||||||
// } catch (DisabledException e) {
|
// } catch (DisabledException e) {
|
||||||
|
// e.printStackTrace();
|
||||||
// return "/login/loginForm.do?error=locked";
|
// return "/login/loginForm.do?error=locked";
|
||||||
// } catch (LockedException e) {
|
// } catch (LockedException e) {
|
||||||
|
// e.printStackTrace();
|
||||||
// return "/login/loginForm.do?error=disable";
|
// return "/login/loginForm.do?error=disable";
|
||||||
// } catch (BadCredentialsException e) {
|
// } catch (BadCredentialsException e) {
|
||||||
|
// e.printStackTrace();
|
||||||
// return "/login/loginForm.do?error=invalid-password";
|
// return "/login/loginForm.do?error=invalid-password";
|
||||||
// } catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
// return "/login/loginForm.do?error=other." + e.toString();
|
// e.printStackTrace();
|
||||||
|
// return "/login/loginForm.do?error=other&message=" + e.toString();
|
||||||
// }
|
// }
|
||||||
|
//
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
|
||||||
|
/* SNS 연동 SSO를 통한 로그인 처리한다.
|
||||||
|
*
|
||||||
|
* return값이 null인 경우, 정상적인 로그인 처리 완료
|
||||||
|
* null이 아닌 경우, REDIRECT되어야 하는 URL(오류 코드 포함)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String loginOauth(HttpServletRequest req, String snsUserId, String deptJsessionId) {
|
||||||
|
|
||||||
|
// SNS 연동 사용자UID로 사용자정보 조회
|
||||||
|
if(StringUtil.isEmpty(snsUserId)) return "/login/loginForm.do?error=req-sns-sso";
|
||||||
|
|
||||||
|
NlibLoginVO nLoginVO = loginDAO.selectLoginUserInfo(snsUserId);
|
||||||
|
|
||||||
|
if(nLoginVO == null) {
|
||||||
|
return "/login/loginForm.do?error=new-membership";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 아이디와 패스워드로, Security 가 알아 볼 수 있는 token 객체로 변경한다.
|
||||||
|
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(nLoginVO.getLoginUserId(), nLoginVO.getUserPwd());
|
||||||
|
|
||||||
|
try {
|
||||||
|
// AuthenticationManager 에 token 을 넘기면 UserDetailsService 가 받아 처리하도록 한다.
|
||||||
|
Authentication authentication = authenticationManager.authenticate(token);
|
||||||
|
|
||||||
|
if(authentication.isAuthenticated()) {
|
||||||
|
SessionConfig.setLoginInfo(deptJsessionId, snsUserId);
|
||||||
|
} else {
|
||||||
|
SessionConfig.setLoginInfo(deptJsessionId, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (DisabledException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "/login/loginForm.do?error=locked";
|
||||||
|
} catch (LockedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "/login/loginForm.do?error=disable";
|
||||||
|
} catch (BadCredentialsException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "/login/loginForm.do?error=invalid-password";
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "/login/loginForm.do?error=other&message=" + e.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String loginDeptSSO(HttpServletRequest req, String snsUserId) {
|
||||||
|
|
||||||
|
// SNS 연동 사용자UID로 사용자정보 조회
|
||||||
|
if(StringUtil.isEmpty(snsUserId)) return "/login/loginForm.do?error=req-sns-sso";
|
||||||
|
|
||||||
|
NlibLoginVO nLoginVO = loginDAO.selectLoginUserInfo(snsUserId);
|
||||||
|
|
||||||
|
if(nLoginVO == null) {
|
||||||
|
return "/login/loginForm.do?error=new-membership";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 아이디와 패스워드로, Security 가 알아 볼 수 있는 token 객체로 변경한다.
|
||||||
|
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(nLoginVO.getLoginUserId(), nLoginVO.getUserPwd());
|
||||||
|
|
||||||
|
try {
|
||||||
|
// AuthenticationManager 에 token 을 넘기면 UserDetailsService 가 받아 처리하도록 한다.
|
||||||
|
Authentication authentication = authenticationManager.authenticate(token);
|
||||||
|
|
||||||
|
// AuthKey 등록
|
||||||
|
SecUserVO userVO = (SecUserVO)authentication.getPrincipal();
|
||||||
|
userVO.getAndCreateAuthKey(req.getSession().getId()); // SET AUTHKEY
|
||||||
|
|
||||||
|
// 실제 SecurityContext 에 authentication 정보를 등록한다.
|
||||||
|
SecurityContextHolder.getContext().setAuthentication(authentication);
|
||||||
|
|
||||||
|
// TODO : 로그인 로그 정보를 통합자료시스템에 전송한다.
|
||||||
|
userVO.setAccIp(req.getRemoteAddr());
|
||||||
|
userVO.setLoginSucsYn("Y");
|
||||||
|
loginDAO.insertLoginLog(userVO);
|
||||||
|
|
||||||
|
} catch (DisabledException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "/login/loginForm.do?error=locked";
|
||||||
|
} catch (LockedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "/login/loginForm.do?error=disable";
|
||||||
|
} catch (BadCredentialsException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "/login/loginForm.do?error=invalid-password";
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "/login/loginForm.do?error=other&message=" + e.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* SNS 연동 SSO를 통한 로그인 처리한다.
|
||||||
|
*
|
||||||
|
* return값이 null인 경우, 정상적인 로그인 처리 완료
|
||||||
|
* null이 아닌 경우, REDIRECT되어야 하는 URL(오류 코드 포함)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String loginDept(HttpServletRequest req, String snsUserId) {
|
||||||
|
|
||||||
|
// SNS 연동 사용자UID로 사용자정보 조회
|
||||||
|
if(StringUtil.isEmpty(snsUserId)) return "/login/loginForm.do?error=req-sns-sso";
|
||||||
|
|
||||||
|
NlibLoginVO nLoginVO = loginDAO.selectLoginUserInfo(snsUserId);
|
||||||
|
|
||||||
|
if(nLoginVO == null) {
|
||||||
|
return "/login/loginForm.do?error=new-membership";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 아이디와 패스워드로, Security 가 알아 볼 수 있는 token 객체로 변경한다.
|
||||||
|
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(nLoginVO.getLoginUserId(), nLoginVO.getUserPwd());
|
||||||
|
|
||||||
|
try {
|
||||||
|
// AuthenticationManager 에 token 을 넘기면 UserDetailsService 가 받아 처리하도록 한다.
|
||||||
|
Authentication authentication = authenticationManager.authenticate(token);
|
||||||
|
|
||||||
|
// AuthKey 등록
|
||||||
|
SecUserVO userVO = (SecUserVO)authentication.getPrincipal();
|
||||||
|
userVO.getAndCreateAuthKey(req.getSession().getId()); // SET AUTHKEY
|
||||||
|
|
||||||
|
// 실제 SecurityContext 에 authentication 정보를 등록한다.
|
||||||
|
SecurityContextHolder.getContext().setAuthentication(authentication);
|
||||||
|
|
||||||
|
// TODO : 로그인 로그 정보를 통합자료시스템에 전송한다.
|
||||||
|
userVO.setAccIp(req.getRemoteAddr());
|
||||||
|
userVO.setLoginSucsYn("Y");
|
||||||
|
loginDAO.insertLoginLog(userVO);
|
||||||
|
|
||||||
|
} catch (DisabledException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "/login/loginForm.do?error=locked";
|
||||||
|
} catch (LockedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "/login/loginForm.do?error=disable";
|
||||||
|
} catch (BadCredentialsException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "/login/loginForm.do?error=invalid-password";
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "/login/loginForm.do?error=other&message=" + e.toString();
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
|
|
||||||
package nlib.user.web;
|
package nlib.user.web;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.URI;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@ -12,46 +10,26 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.json.simple.JSONObject;
|
|
||||||
import org.json.simple.parser.JSONParser;
|
|
||||||
import org.json.simple.parser.ParseException;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.http.HttpEntity;
|
|
||||||
import org.springframework.http.HttpHeaders;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.security.web.savedrequest.HttpSessionRequestCache;
|
import org.springframework.security.web.savedrequest.HttpSessionRequestCache;
|
||||||
import org.springframework.security.web.savedrequest.RequestCache;
|
import org.springframework.security.web.savedrequest.RequestCache;
|
||||||
import org.springframework.security.web.savedrequest.SavedRequest;
|
import org.springframework.security.web.savedrequest.SavedRequest;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.util.LinkedMultiValueMap;
|
|
||||||
import org.springframework.util.MultiValueMap;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
import org.springframework.web.util.UriComponentsBuilder;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
|
|
||||||
import com.github.scribejava.core.model.OAuth2AccessToken;
|
|
||||||
|
|
||||||
import egovframework.com.ext.oauth.service.OAuthConfig;
|
import egovframework.com.ext.oauth.service.OAuthConfig;
|
||||||
import egovframework.com.ext.oauth.service.OAuthLogin;
|
import egovframework.com.ext.oauth.service.OAuthLogin;
|
||||||
import egovframework.com.ext.oauth.service.OAuthUniversalUser;
|
import egovframework.com.ext.oauth.service.OAuthUniversalUser;
|
||||||
import egovframework.com.ext.oauth.service.OAuthVO;
|
import egovframework.com.ext.oauth.service.OAuthVO;
|
||||||
import nlib.cmm.snslogin.GoogleOAuthResponse;
|
import nlib.cmm.service.NlibProperty;
|
||||||
import nlib.cmm.snslogin.KakaoController;
|
import nlib.cmm.session.SessionConfig;
|
||||||
import nlib.cmm.snslogin.NaverLoginBO;
|
|
||||||
import nlib.user.service.LoginService;
|
import nlib.user.service.LoginService;
|
||||||
import nlib.util.StringUtil;
|
import nlib.util.StringUtil;
|
||||||
|
|
||||||
@ -119,31 +97,86 @@ public class LoginController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/login/loginForm.do")
|
@RequestMapping("/login/loginForm.do")
|
||||||
public String loginForm(HttpServletRequest req, @RequestParam(required = false) String error,
|
public String loginForm(HttpServletRequest req,
|
||||||
@RequestParam(required = false) String logout, Model model, HttpSession session) {
|
@RequestParam(required = false) String error,
|
||||||
if (error != null) {
|
@RequestParam(required = false) String message,
|
||||||
model.addAttribute("error", String.format("ID와 비밀번호를 확인하여 주시기 바랍니다. %s", error));
|
@RequestParam(required = false) String logout,
|
||||||
}
|
RedirectAttributes redirectAttrs,
|
||||||
if (logout != null) {
|
@RequestParam Map<String, String> paramMap,
|
||||||
model.addAttribute("logout", String.format("로그아웃하였습니다 %s", logout));
|
Model model,
|
||||||
}
|
HttpSession session) {
|
||||||
|
|
||||||
|
//----------------------------------------------
|
||||||
|
// 지방문화원 사이트에서 접속한 경우, 지방문화원 정보 확인
|
||||||
|
//----------------------------------------------
|
||||||
|
String deptJsessionId = paramMap.get("deptJsessionId");
|
||||||
|
String deptHostName = paramMap.get("deptHostName");
|
||||||
|
String deptReturnUrl = paramMap.get("deptReturnUrl");
|
||||||
|
String deptHomeUrl = paramMap.get("deptHomeUrl");
|
||||||
|
|
||||||
|
log.debug("loginForm > deptJsessionId = " + deptJsessionId);
|
||||||
|
log.debug("loginForm > deptHostName = " + deptHostName);
|
||||||
|
log.debug("loginForm > deptReturnUrl = " + deptReturnUrl);
|
||||||
|
log.debug("loginForm > deptHomeUrl = " + deptHomeUrl);
|
||||||
|
|
||||||
|
session.setAttribute("deptJsessionId", deptJsessionId);
|
||||||
|
session.setAttribute("deptHostName", deptHostName);
|
||||||
|
session.setAttribute("deptReturnUrl", (StringUtil.isNotEmpty(deptReturnUrl) ? StringUtil.decodeBase64(deptReturnUrl) : null));
|
||||||
|
session.setAttribute("deptHomeUrl", (StringUtil.isNotEmpty(deptHomeUrl) ? StringUtil.decodeBase64(deptHomeUrl) : null));
|
||||||
|
|
||||||
|
//----------------------------------------------
|
||||||
// SNS 연동 URL 생성
|
// SNS 연동 URL 생성
|
||||||
OAuthLogin naverLogin = new OAuthLogin(naverAuthVO);
|
//----------------------------------------------
|
||||||
|
OAuthLogin naverLogin = new OAuthLogin(naverAuthVO, deptJsessionId);
|
||||||
log.debug("naverLogin.getOAuthURL() = "+naverLogin.getOAuthURL());
|
log.debug("naverLogin.getOAuthURL() = "+naverLogin.getOAuthURL());
|
||||||
model.addAttribute("naverUrl", naverLogin.getOAuthURL());
|
model.addAttribute("naverUrl", naverLogin.getOAuthURL());
|
||||||
|
|
||||||
OAuthLogin googleLogin = new OAuthLogin(googleAuthVO);
|
OAuthLogin googleLogin = new OAuthLogin(googleAuthVO, deptJsessionId);
|
||||||
log.debug("googleLogin.getOAuthURL() = "+googleLogin.getOAuthURL());
|
log.debug("googleLogin.getOAuthURL() = "+googleLogin.getOAuthURL());
|
||||||
model.addAttribute("googleUrl", googleLogin.getOAuthURL());
|
model.addAttribute("googleUrl", googleLogin.getOAuthURL());
|
||||||
|
|
||||||
OAuthLogin kakaoLogin = new OAuthLogin(kakaoAuthVO);
|
OAuthLogin kakaoLogin = new OAuthLogin(kakaoAuthVO, deptJsessionId);
|
||||||
log.debug("kakaoLogin.getOAuthURL() = "+kakaoLogin.getOAuthURL());
|
log.debug("kakaoLogin.getOAuthURL() = "+kakaoLogin.getOAuthURL());
|
||||||
model.addAttribute("kakaoUrl", kakaoLogin.getOAuthURL());
|
model.addAttribute("kakaoUrl", kakaoLogin.getOAuthURL());
|
||||||
|
|
||||||
|
model.addAttribute("error", error);
|
||||||
|
model.addAttribute("message", message);
|
||||||
|
model.addAttribute("logout", String.format("로그아웃하였습니다 %s", logout));
|
||||||
|
|
||||||
return "nlib/login/loginForm";
|
return "nlib/login/loginForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @RequestMapping("/login/loginForm.do")
|
||||||
|
// public String loginForm(HttpServletRequest req,
|
||||||
|
// @RequestParam(required = false) String error,
|
||||||
|
// @RequestParam(required = false) String message,
|
||||||
|
// @RequestParam(required = false) String logout,
|
||||||
|
// Model model,
|
||||||
|
// HttpSession session) {
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// model.addAttribute("error", error);
|
||||||
|
// model.addAttribute("message", message);
|
||||||
|
// model.addAttribute("logout", String.format("로그아웃하였습니다 %s", logout));
|
||||||
|
//
|
||||||
|
// // SNS 연동 URL 생성
|
||||||
|
// OAuthLogin naverLogin = new OAuthLogin(naverAuthVO);
|
||||||
|
// log.debug("naverLogin.getOAuthURL() = "+naverLogin.getOAuthURL());
|
||||||
|
// model.addAttribute("naverUrl", naverLogin.getOAuthURL());
|
||||||
|
//
|
||||||
|
// OAuthLogin googleLogin = new OAuthLogin(googleAuthVO);
|
||||||
|
// log.debug("googleLogin.getOAuthURL() = "+googleLogin.getOAuthURL());
|
||||||
|
// model.addAttribute("googleUrl", googleLogin.getOAuthURL());
|
||||||
|
//
|
||||||
|
// OAuthLogin kakaoLogin = new OAuthLogin(kakaoAuthVO);
|
||||||
|
// log.debug("kakaoLogin.getOAuthURL() = "+kakaoLogin.getOAuthURL());
|
||||||
|
// model.addAttribute("kakaoUrl", kakaoLogin.getOAuthURL());
|
||||||
|
//
|
||||||
|
// model.addAttribute("coutTest", "서울시 마포구");
|
||||||
|
//
|
||||||
|
// return "nlib/login/loginForm";
|
||||||
|
// }
|
||||||
|
|
||||||
// @RequestMapping("/login/loginForm_BK20210817.do")
|
// @RequestMapping("/login/loginForm_BK20210817.do")
|
||||||
// public String loginForm_BK20210817(HttpServletRequest req, @RequestParam(required = false) String error,
|
// public String loginForm_BK20210817(HttpServletRequest req, @RequestParam(required = false) String error,
|
||||||
// @RequestParam(required = false) String logout, Model model, HttpSession session) {
|
// @RequestParam(required = false) String logout, Model model, HttpSession session) {
|
||||||
@ -177,52 +210,70 @@ public class LoginController {
|
|||||||
// return "nlib/login/loginForm";
|
// return "nlib/login/loginForm";
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
@RequestMapping(value = "/login/{oauthService}Callback.do", method = { RequestMethod.GET, RequestMethod.POST})
|
// @RequestMapping(value = "/login/{oauthService}Callback.do", method = { RequestMethod.GET, RequestMethod.POST})
|
||||||
public String oauthLoginCallback(@PathVariable String oauthService,
|
// public String oauthLoginCallback(
|
||||||
Model model, @RequestParam String code, HttpSession session) throws Exception {
|
// HttpServletRequest req,
|
||||||
|
// @PathVariable String oauthService,
|
||||||
String redirectUrl = "/index.do";
|
// Model model,
|
||||||
|
// @RequestParam String code,
|
||||||
log.debug("oauthLoginCallback: service={}", oauthService);
|
// @RequestParam Map<String, String> paramMap,
|
||||||
log.debug("===>>> code = "+ code);
|
// HttpSession session) throws Exception {
|
||||||
|
//
|
||||||
OAuthVO oauthVO = null;
|
// String redirectUrl = "/index.do";
|
||||||
if (StringUtils.equals(OAuthConfig.GOOGLE_SERVICE_NAME, oauthService))
|
//
|
||||||
oauthVO = googleAuthVO;
|
// log.debug("oauthLoginCallback: service={}", oauthService);
|
||||||
else if (StringUtils.equals(OAuthConfig.NAVER_SERVICE_NAME, oauthService))
|
// log.debug("===>>> code = "+ code);
|
||||||
oauthVO = naverAuthVO;
|
//
|
||||||
else if (StringUtils.equals(OAuthConfig.KAKAO_SERVICE_NAME, oauthService))
|
// OAuthVO oauthVO = null;
|
||||||
oauthVO = kakaoAuthVO;
|
// if (StringUtils.equals(OAuthConfig.GOOGLE_SERVICE_NAME, oauthService))
|
||||||
else {
|
// oauthVO = googleAuthVO;
|
||||||
throw new Exception("SNS 연동 콜백정보가 올바르지 않습니다.");
|
// else if (StringUtils.equals(OAuthConfig.NAVER_SERVICE_NAME, oauthService))
|
||||||
}
|
// oauthVO = naverAuthVO;
|
||||||
|
// else if (StringUtils.equals(OAuthConfig.KAKAO_SERVICE_NAME, oauthService))
|
||||||
// 1. code를 이용해서 Access Token 받기
|
// oauthVO = kakaoAuthVO;
|
||||||
// 2. Access Token을 이용해서 사용자 제공정보 가져오기
|
// else {
|
||||||
OAuthLogin oauthLogin = new OAuthLogin(oauthVO);
|
// throw new Exception("SNS 연동 콜백정보가 올바르지 않습니다.");
|
||||||
|
// }
|
||||||
OAuthUniversalUser oauthUser = oauthLogin.getUserProfile(code); // 1,2번 동시
|
//
|
||||||
log.debug("Profile ===>>" + oauthUser);
|
// // 1. code를 이용해서 Access Token 받기
|
||||||
|
// // 2. Access Token을 이용해서 사용자 제공정보 가져오기
|
||||||
String resultDBInfo = loginService.loginOauth(oauthUser.getUid());
|
// String deptJsessionId = paramMap.get("deptJsessionId");
|
||||||
|
// OAuthLogin oauthLogin = new OAuthLogin(oauthVO, deptJsessionId);
|
||||||
// oAuth를 통한 SNS연동이 실패한 경우
|
//
|
||||||
if(oauthUser == null || !oauthUser.isValid()) {
|
// OAuthUniversalUser oauthUser = oauthLogin.getUserProfile(code); // 1,2번 동시
|
||||||
model.addAttribute("code", "NOMEM");
|
// log.debug("Profile ===>>" + oauthUser);
|
||||||
model.addAttribute("message", "먼저 회원가입하신 후, 이용하여 주시기 바랍니다.");
|
//
|
||||||
}
|
// //-----------------------------------------------------------------
|
||||||
// SNS 로그인은 정상적이나, NLIB 시스템에 등록되지 않은 사용자 : 회원가입으로 전환
|
// // 호스트에 따른 별도 로그인 처리
|
||||||
else if(oauthUser.isValid() && resultDBInfo == null) {
|
// //-----------------------------------------------------------------
|
||||||
model.addAttribute("code", "GONEW");
|
// // 해당 호스트로 로그인처리 요청
|
||||||
model.addAttribute("message", "먼저 회원가입하신 후, 이용 가능합니다. 해당 SNS 계정 정보로 회원가입을 진행하시겠습니까?");
|
// //loginService.loginDept(req, oauthUser.getUid());
|
||||||
}
|
//
|
||||||
// 정상 SNS 연동 로그인
|
// //-----------------------------------------------------------------
|
||||||
else if(oauthUser.isValid() && resultDBInfo != null) {
|
//
|
||||||
// 세션에 설정된 redirect 주소 확인
|
// String loginResult = loginService.loginOauth(req, oauthUser.getUid(), deptJsessionId);
|
||||||
model.addAttribute("message", "정상적으로 로그인되었습니다.");
|
//
|
||||||
}
|
// // oAuth를 통한 SNS연동이 실패한 경우
|
||||||
return "redirect:" + redirectUrl;
|
// if(oauthUser == null || !oauthUser.isValid()) {
|
||||||
}
|
// model.addAttribute("message", "먼저 회원가입하신 후, 이용하여 주시기 바랍니다.");
|
||||||
|
// redirectUrl = NlibProperty.getString("member.new.url"); // "/member/insertMemberInfoForm.do"
|
||||||
|
// }
|
||||||
|
// // 정상 SNS 연동 로그인
|
||||||
|
// else if(oauthUser.isValid() && loginResult == null) {
|
||||||
|
// // 세션에 설정된 redirect 주소 확인
|
||||||
|
// model.addAttribute("message", "정상적으로 로그인되었습니다.");
|
||||||
|
// }
|
||||||
|
// // SNS 로그인은 정상적이나, NLIB 시스템에 등록되지 않은 사용자 : 회원가입으로 전환
|
||||||
|
// else {
|
||||||
|
// model.addAttribute("code", "GONEW");
|
||||||
|
// model.addAttribute("message", "먼저 회원가입하신 후, 이용 가능합니다. 해당 SNS 계정 정보로 회원가입을 진행하시겠습니까?");
|
||||||
|
// redirectUrl = loginResult;
|
||||||
|
// }
|
||||||
|
// String deptReturnUrl = (String)session.getAttribute("deptReturnUrl");
|
||||||
|
// if(StringUtil.isNotEmpty(deptReturnUrl)) redirectUrl = deptReturnUrl;
|
||||||
|
//
|
||||||
|
// return "redirect:" + redirectUrl;
|
||||||
|
// }
|
||||||
|
|
||||||
// 네이버 로그인 성공시 callback호출 메소드
|
// 네이버 로그인 성공시 callback호출 메소드
|
||||||
// @RequestMapping(value = "/login/naverCallback_BK20210817.do", method = { RequestMethod.GET, RequestMethod.POST })
|
// @RequestMapping(value = "/login/naverCallback_BK20210817.do", method = { RequestMethod.GET, RequestMethod.POST })
|
||||||
@ -326,6 +377,128 @@ public class LoginController {
|
|||||||
// }// end kakaoLogin()
|
// }// end kakaoLogin()
|
||||||
//
|
//
|
||||||
|
|
||||||
|
// @RequestMapping("/login/loginForm.do")
|
||||||
|
// public String loginForm(HttpServletRequest req,
|
||||||
|
// @RequestParam(required = false) String error,
|
||||||
|
// @RequestParam(required = false) String message,
|
||||||
|
// @RequestParam(required = false) String logout,
|
||||||
|
// Model model,
|
||||||
|
// HttpSession session) {
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// model.addAttribute("error", error);
|
||||||
|
// model.addAttribute("message", message);
|
||||||
|
// model.addAttribute("logout", String.format("로그아웃하였습니다 %s", logout));
|
||||||
|
//
|
||||||
|
// // SNS 연동 URL 생성
|
||||||
|
// OAuthLogin naverLogin = new OAuthLogin(naverAuthVO);
|
||||||
|
// log.debug("naverLogin.getOAuthURL() = "+naverLogin.getOAuthURL());
|
||||||
|
// model.addAttribute("naverUrl", naverLogin.getOAuthURL());
|
||||||
|
//
|
||||||
|
// OAuthLogin googleLogin = new OAuthLogin(googleAuthVO);
|
||||||
|
// log.debug("googleLogin.getOAuthURL() = "+googleLogin.getOAuthURL());
|
||||||
|
// model.addAttribute("googleUrl", googleLogin.getOAuthURL());
|
||||||
|
//
|
||||||
|
// OAuthLogin kakaoLogin = new OAuthLogin(kakaoAuthVO);
|
||||||
|
// log.debug("kakaoLogin.getOAuthURL() = "+kakaoLogin.getOAuthURL());
|
||||||
|
// model.addAttribute("kakaoUrl", kakaoLogin.getOAuthURL());
|
||||||
|
//
|
||||||
|
// model.addAttribute("coutTest", "서울시 마포구");
|
||||||
|
//
|
||||||
|
// return "nlib/login/loginForm";
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @RequestMapping("/login/loginForm_BK20210817.do")
|
||||||
|
// public String loginForm_BK20210817(HttpServletRequest req, @RequestParam(required = false) String error,
|
||||||
|
// @RequestParam(required = false) String logout, Model model, HttpSession session) {
|
||||||
|
// if (error != null) {
|
||||||
|
// model.addAttribute("error", String.format("ID와 비밀번호를 확인하여 주시기 바랍니다. %s", error));
|
||||||
|
// }
|
||||||
|
// if (logout != null) {
|
||||||
|
// model.addAttribute("logout", String.format("로그아웃하였습니다 %s", logout));
|
||||||
|
// }
|
||||||
|
// // 네이버 로그인 URL 생성
|
||||||
|
// /* 네이버아이디로 인증 URL을 생성하기 위하여 naverLoginBO클래스의 getAuthorizationUrl메소드 호출 */
|
||||||
|
// naverLoginBO.setRedirect_url("http://nlib.nculture.org/nlib/login/naverCallback.do");
|
||||||
|
// String naverAuthUrl = naverLoginBO.getAuthorizationUrl(session);
|
||||||
|
//
|
||||||
|
// // 구글 로그인 URL 생성
|
||||||
|
// String googleUrl = "https://accounts.google.com/o/oauth2/v2/auth?"
|
||||||
|
// + "client_id=879126511006-jro7bld7b2epl3n5mkksp0p24k2inbpu.apps.googleusercontent.com"
|
||||||
|
// + "&redirect_uri=http://nlib.nculture.org/nlib/login/googleCallback.do"
|
||||||
|
// + "&response_type=code"
|
||||||
|
// + "&scope=email%20profile%20openid"
|
||||||
|
// + "&access_type=offline";
|
||||||
|
//
|
||||||
|
// // 카카오 로그인 URL 생성
|
||||||
|
// String k_redirect_url="http://nlib.nculture.org/nlib/login/kakaoCallback.do";
|
||||||
|
// String kakaoUrl = KakaoController.getAuthorizationUrl(session,k_redirect_url);
|
||||||
|
//
|
||||||
|
// model.addAttribute("naverUrl", naverAuthUrl);
|
||||||
|
// model.addAttribute("googleUrl", googleUrl);
|
||||||
|
// model.addAttribute("kakaoUrl", kakaoUrl);
|
||||||
|
//
|
||||||
|
// return "nlib/login/loginForm";
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
@RequestMapping(value = "/login/{oauthService}Callback.do", method = { RequestMethod.GET, RequestMethod.POST})
|
||||||
|
public String oauthLoginCallback(
|
||||||
|
HttpServletRequest req,
|
||||||
|
@PathVariable String oauthService,
|
||||||
|
Model model,
|
||||||
|
@RequestParam String code,
|
||||||
|
@RequestParam Map<String, String> paramMap,
|
||||||
|
HttpSession session) throws Exception {
|
||||||
|
|
||||||
|
String redirectUrl = "/index.do";
|
||||||
|
|
||||||
|
log.debug("oauthLoginCallback: service={}", oauthService);
|
||||||
|
log.debug("===>>> code = "+ code);
|
||||||
|
|
||||||
|
OAuthVO oauthVO = null;
|
||||||
|
if (StringUtils.equals(OAuthConfig.GOOGLE_SERVICE_NAME, oauthService))
|
||||||
|
oauthVO = googleAuthVO;
|
||||||
|
else if (StringUtils.equals(OAuthConfig.NAVER_SERVICE_NAME, oauthService))
|
||||||
|
oauthVO = naverAuthVO;
|
||||||
|
else if (StringUtils.equals(OAuthConfig.KAKAO_SERVICE_NAME, oauthService))
|
||||||
|
oauthVO = kakaoAuthVO;
|
||||||
|
else {
|
||||||
|
throw new Exception("SNS 연동 콜백정보가 올바르지 않습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
String deptJsessionId = paramMap.get("deptJsessionId");
|
||||||
|
|
||||||
|
// 1. code를 이용해서 Access Token 받기
|
||||||
|
// 2. Access Token을 이용해서 사용자 제공정보 가져오기
|
||||||
|
OAuthLogin oauthLogin = new OAuthLogin(oauthVO, deptJsessionId);
|
||||||
|
|
||||||
|
OAuthUniversalUser oauthUser = oauthLogin.getUserProfile(code); // 1,2번 동시
|
||||||
|
log.debug("Profile ===>>" + oauthUser);
|
||||||
|
|
||||||
|
String loginResult = loginService.loginOauth(req, oauthUser.getUid(), deptJsessionId);
|
||||||
|
|
||||||
|
// oAuth를 통한 SNS연동이 실패한 경우
|
||||||
|
if(oauthUser == null || !oauthUser.isValid()) {
|
||||||
|
model.addAttribute("message", "먼저 회원가입하신 후, 이용하여 주시기 바랍니다.");
|
||||||
|
redirectUrl = NlibProperty.getString("member.new.url"); // "/member/insertMemberInfoForm.do"
|
||||||
|
}
|
||||||
|
// 정상 SNS 연동 로그인
|
||||||
|
else if(oauthUser.isValid() && loginResult == null) {
|
||||||
|
// 세션에 설정된 redirect 주소 확인
|
||||||
|
model.addAttribute("message", "정상적으로 로그인되었습니다.");
|
||||||
|
String deptHomeUrl = (String)session.getAttribute("deptHomeUrl");
|
||||||
|
redirectUrl = deptHomeUrl + "/login/loginDeptSSO.do";
|
||||||
|
}
|
||||||
|
// SNS 로그인은 정상적이나, NLIB 시스템에 등록되지 않은 사용자 : 회원가입으로 전환
|
||||||
|
else {
|
||||||
|
model.addAttribute("code", "GONEW");
|
||||||
|
model.addAttribute("message", "먼저 회원가입하신 후, 이용 가능합니다. 해당 SNS 계정 정보로 회원가입을 진행하시겠습니까?");
|
||||||
|
redirectUrl = loginResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "redirect:" + redirectUrl;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 로그인을 처리한다. (스프링 시큐리티 로그인 수행)
|
* 로그인을 처리한다. (스프링 시큐리티 로그인 수행)
|
||||||
*
|
*
|
||||||
@ -358,6 +531,70 @@ public class LoginController {
|
|||||||
return "redirect:" + redirectUrl;
|
return "redirect:" + redirectUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/login/loginDept.do")
|
||||||
|
public String loginDept(
|
||||||
|
HttpServletRequest req,
|
||||||
|
HttpServletResponse res,
|
||||||
|
HttpSession session,
|
||||||
|
@RequestParam(required = false) String returnUrl,
|
||||||
|
ModelMap model) throws Exception {
|
||||||
|
|
||||||
|
String url = req.getRequestURL().toString();
|
||||||
|
String deptHomeUrl = url.replaceAll(req.getRequestURI(), "") + req.getContextPath();
|
||||||
|
String deptReturnUrl = deptHomeUrl + (StringUtil.isEmpty(returnUrl) ? "/" : returnUrl);
|
||||||
|
String deptHostName = StringUtil.getHostName(url);
|
||||||
|
|
||||||
|
session.setAttribute("deptHostName", deptHostName);
|
||||||
|
session.setAttribute("deptReturnUrl", deptReturnUrl);
|
||||||
|
session.setAttribute("deptHomeUrl", deptHomeUrl);
|
||||||
|
|
||||||
|
log.debug("REQ URL = " + url);
|
||||||
|
log.debug("deptJsessionId = " + session.getId());
|
||||||
|
log.debug("deptHostName = " + deptHostName);
|
||||||
|
log.debug("deptReturnUrl = " + deptReturnUrl);
|
||||||
|
log.debug("deptHomeUrl = " + deptHomeUrl);
|
||||||
|
|
||||||
|
String params = "deptJsessionId=" + session.getId() +
|
||||||
|
"&deptHostName=" + deptHostName +
|
||||||
|
"&deptHomeUrl=" + StringUtil.encodeBase64(deptHomeUrl) +
|
||||||
|
"&deptReturnUrl=" + StringUtil.encodeBase64(deptReturnUrl);
|
||||||
|
|
||||||
|
return "redirect:" + NlibProperty.getString("nculture.login.redirect.url") + "?" + params;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/login/loginDeptSSO.do")
|
||||||
|
public String loginDeptSSO(
|
||||||
|
HttpServletRequest req,
|
||||||
|
HttpServletResponse res,
|
||||||
|
HttpSession session,
|
||||||
|
ModelMap model) throws Exception {
|
||||||
|
|
||||||
|
String redirectUrl = "/index.do";
|
||||||
|
|
||||||
|
String snsUserId = SessionConfig.getLoginInfo(session.getId());
|
||||||
|
String loginResult = loginService.loginDeptSSO(req, snsUserId);
|
||||||
|
|
||||||
|
// oAuth를 통한 SNS연동이 실패한 경우
|
||||||
|
if(loginResult == null) {
|
||||||
|
// 세션에 설정된 redirect 주소 확인
|
||||||
|
String deptReturnUrl = (String)session.getAttribute("deptReturnUrl");
|
||||||
|
|
||||||
|
log.debug("loginDeptSSO > deptReturnUrl = " + deptReturnUrl);
|
||||||
|
if(StringUtil.isNotEmpty(deptReturnUrl)) {
|
||||||
|
redirectUrl = deptReturnUrl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// SNS 로그인은 정상적이나, NLIB 시스템에 등록되지 않은 사용자 : 회원가입으로 전환
|
||||||
|
else {
|
||||||
|
model.addAttribute("code", "GONEW");
|
||||||
|
model.addAttribute("message", "먼저 회원가입하신 후, 이용 가능합니다. 해당 SNS 계정 정보로 회원가입을 진행하시겠습니까?");
|
||||||
|
redirectUrl = loginResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "redirect:" + redirectUrl;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 로그아웃 후의 처리를 담당한다. 스프링 시큐리티에서 로그아웃이 수행된 후, 호출된다.
|
* 로그아웃 후의 처리를 담당한다. 스프링 시큐리티에서 로그아웃이 수행된 후, 호출된다.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1,13 +1,19 @@
|
|||||||
package nlib.util;
|
package nlib.util;
|
||||||
|
|
||||||
|
import java.net.URL;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.Base64.Decoder;
|
import java.util.Base64.Decoder;
|
||||||
import java.util.Base64.Encoder;
|
import java.util.Base64.Encoder;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import egovframework.com.utl.fcc.service.EgovStringUtil;
|
import egovframework.com.utl.fcc.service.EgovStringUtil;
|
||||||
|
import nlib.user.web.LoginController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -33,6 +39,8 @@ import egovframework.com.utl.fcc.service.EgovStringUtil;
|
|||||||
*/
|
*/
|
||||||
public class StringUtil extends EgovStringUtil {
|
public class StringUtil extends EgovStringUtil {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(StringUtil.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Null 이거나, 빈문자열(공백 포함)인 경우, true를 리턴한다.
|
* Null 이거나, 빈문자열(공백 포함)인 경우, true를 리턴한다.
|
||||||
*
|
*
|
||||||
@ -137,4 +145,31 @@ public class StringUtil extends EgovStringUtil {
|
|||||||
Decoder decoder = Base64.getDecoder();
|
Decoder decoder = Base64.getDecoder();
|
||||||
return new String(decoder.decode(str.getBytes()));
|
return new String(decoder.decode(str.getBytes()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* URL 주소에서 호스트명을 리턴한다.
|
||||||
|
*
|
||||||
|
* 프로토콜://호스트.도메인/URI 에서 호스트명 리턴
|
||||||
|
* (ex) https://seoul.nculture.org/abc/def.do -> seoul 을 리턴한다.
|
||||||
|
*
|
||||||
|
* @param url
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static String getHostName(String url) {
|
||||||
|
if(isEmpty(url)) return "";
|
||||||
|
|
||||||
|
String hostName = "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
final URL urlObj = new URL(url);
|
||||||
|
hostName = urlObj.getHost();
|
||||||
|
if(isEmpty(hostName)) return "";
|
||||||
|
} catch(Exception e) {
|
||||||
|
log.error("[ERROR] getHostName(..) : " + e.toString());
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return (hostName.split("\\."))[0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,9 @@
|
|||||||
|
|
||||||
<!-- Type Aliases 설정-->
|
<!-- Type Aliases 설정-->
|
||||||
<typeAliases>
|
<typeAliases>
|
||||||
<typeAlias alias="egovMap" type="egovframework.rte.psl.dataaccess.util.EgovMap" />
|
<typeAlias alias="egovMap" type="egovframework.rte.psl.dataaccess.util.EgovMap" />
|
||||||
|
<typeAlias alias="NlibLoginVO" type="nlib.user.service.NlibLoginVO" />
|
||||||
|
<typeAlias alias="SecUserVO" type="nlib.security.SecUserVO" />
|
||||||
</typeAliases>
|
</typeAliases>
|
||||||
|
|
||||||
</configuration>
|
</configuration>
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?><!--Converted at: Wed May 11 15:49:38 KST 2016-->
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="LoginDAO">
|
||||||
|
|
||||||
|
<select id="selectLoginUserInfo" parameterType="String" resultType="NlibLoginVO">
|
||||||
|
SELECT A.*, B.SNS_DIV, B.SNS_USER_ID, SNS_LOGIN_ID, SSO_REG_DT,
|
||||||
|
CASE WHEN A.USER_DIV = '1' THEN 'ROLE_USER'
|
||||||
|
WHEN A.USER_DIV = '2' THEN 'ROLE_USER, ROLE_ADMIN'
|
||||||
|
WHEN A.USER_DIV = '3' THEN 'ROLE_USER, ROLE_ADMIN, ROLE_SYSTEM'
|
||||||
|
ELSE ''
|
||||||
|
END AS AUTHORITY_LIST
|
||||||
|
FROM TMP_SM_USER A /* 사용자정보 */
|
||||||
|
JOIN TMP_SM_USER_SNS B /* 사용자 SNS 정보 */
|
||||||
|
ON A.USER_ID = B.USER_ID
|
||||||
|
WHERE A.USE_YN = 'Y'
|
||||||
|
AND B.SNS_DIV = 'N'
|
||||||
|
AND B.SNS_USER_ID = #{snsUserId}
|
||||||
|
AND B.SSO_DEL_DT IS NULL /* 연동해제건 제외 */
|
||||||
|
LIMIT 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertLoginLog" parameterType="NlibLoginVO">
|
||||||
|
INSERT INTO SM_ACC_LOG /* 접속로그 */
|
||||||
|
( USER_ID
|
||||||
|
,USER_NM
|
||||||
|
,DEPT_SEQ
|
||||||
|
,DEPT_NM
|
||||||
|
,ACC_IP
|
||||||
|
,LOGIN_SUCS_YN
|
||||||
|
,ACC_DATE
|
||||||
|
) VALUES (
|
||||||
|
#{userId}
|
||||||
|
,#{userNm}
|
||||||
|
,#{deptSeq}
|
||||||
|
,#{deptNm}
|
||||||
|
,#{accIp}
|
||||||
|
,'Y'
|
||||||
|
,NOW()
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?><!--Converted at: Wed May 11 15:49:38 KST 2016-->
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="SecUserDAO">
|
||||||
|
|
||||||
|
<select id="loadUserByUsername" parameterType="String" resultType="SecUserVO">
|
||||||
|
SELECT A.*,
|
||||||
|
CASE WHEN A.USER_DIV = '1' THEN 'ROLE_USER'
|
||||||
|
WHEN A.USER_DIV = '2' THEN 'ROLE_USER, ROLE_ADMIN'
|
||||||
|
WHEN A.USER_DIV = '3' THEN 'ROLE_USER, ROLE_ADMIN, ROLE_SYSTEM'
|
||||||
|
ELSE ''
|
||||||
|
END AS AUTHORITY_LIST
|
||||||
|
FROM TMP_SM_USER A /* 사용자정보 */
|
||||||
|
WHERE A.USE_YN = 'Y'
|
||||||
|
AND A.LOGIN_USER_ID = #{loginUserId}
|
||||||
|
LIMIT 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -98,3 +98,20 @@ oauth2.client.provider.naver.user-name-attribute = response
|
|||||||
# \uc190\ub2d8\uc815\ubcf4
|
# \uc190\ub2d8\uc815\ubcf4
|
||||||
#----------------------------------------
|
#----------------------------------------
|
||||||
guest.userid = GUEST
|
guest.userid = GUEST
|
||||||
|
#----------------------------------------
|
||||||
|
# \ub85c\uadf8\uc778/\ud68c\uc6d0\uac00\uc785\uad00\ub828 URL \uc815\ubcf4
|
||||||
|
#----------------------------------------
|
||||||
|
member.new.url = /member/insertMemberInfoForm.do
|
||||||
|
member.login.url = /member/insertMemberInfoForm.do
|
||||||
|
# \uc9c0\ubc29\ubb38\ud654\uc6d0\uc5d0\uc11c \uc811\uc18d\uc2dc \ub9ac\ub2e4\uc774\ub809\ud2b8\ub420 URL \uc815\ubcf4
|
||||||
|
nculture.login.redirect.url = http://nlib.nculture.org/nlib/login/loginForm.do
|
||||||
|
|
||||||
|
#----------------------------------------
|
||||||
|
# \uc0ac\uc6a9\uc790\uad8c\ud55c\uba85
|
||||||
|
#----------------------------------------
|
||||||
|
# \uc77c\ubc18\uc0ac\uc6a9\uc790
|
||||||
|
auth.role.user = ROLE_USER
|
||||||
|
# \uad00\ub9ac\uc790
|
||||||
|
auth.role.admin = ROLE_ADMIN
|
||||||
|
# \uc2dc\uc2a4\ud15c\uad00\ub9ac\uc790
|
||||||
|
auth.role.system = ROLE_SYSTEM
|
||||||
|
|||||||
@ -49,6 +49,13 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
error : ${error }
|
||||||
|
<br>
|
||||||
|
message : ${message }
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
<!-- 네이버 로그인 화면으로 이동 시키는 URL -->
|
<!-- 네이버 로그인 화면으로 이동 시키는 URL -->
|
||||||
<!-- 네이버 로그인 화면에서 ID, PW를 올바르게 입력하면 callback 메소드 실행 요청 -->
|
<!-- 네이버 로그인 화면에서 ID, PW를 올바르게 입력하면 callback 메소드 실행 요청 -->
|
||||||
<div id="naver_id_login" style="text-align:center"><a href="${naverUrl}" ><img width="223" src="${pageContext.request.contextPath}/images/nlib/sns/naver_login_btn.png"/></a></div>
|
<div id="naver_id_login" style="text-align:center"><a href="${naverUrl}" ><img width="223" src="${pageContext.request.contextPath}/images/nlib/sns/naver_login_btn.png"/></a></div>
|
||||||
@ -60,5 +67,10 @@
|
|||||||
<input type="button" onclick="findInfo();" value="비밀번호 초기화">
|
<input type="button" onclick="findInfo();" value="비밀번호 초기화">
|
||||||
</div>
|
</div>
|
||||||
<script src="https://apis.google.com/js/platform.js?onload=init" async defer></script>
|
<script src="https://apis.google.com/js/platform.js?onload=init" async defer></script>
|
||||||
|
-------------------
|
||||||
|
<input type="text" value="<c:out value="${coutTest}" />" />
|
||||||
|
_______________
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@ -11,7 +11,6 @@
|
|||||||
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/inform/selectPrivacyInfo.do';">개인정보처리방침</a></li>
|
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/inform/selectPrivacyInfo.do';">개인정보처리방침</a></li>
|
||||||
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/inform/selectTermsInfo.do';">이용약관</a></li>
|
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/inform/selectTermsInfo.do';">이용약관</a></li>
|
||||||
|
|
||||||
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/login/loginForm.do';">로그인</a></li>
|
|
||||||
<sec:authorize access="not isAuthenticated()">
|
<sec:authorize access="not isAuthenticated()">
|
||||||
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/login/loginForm.do';">로그인</a></li>
|
<li><a href="#" onclick="javascript:location.href='${pageContext.request.contextPath}/login/loginForm.do';">로그인</a></li>
|
||||||
</sec:authorize>
|
</sec:authorize>
|
||||||
@ -26,8 +25,8 @@
|
|||||||
</sec:authorize>
|
</sec:authorize>
|
||||||
<li>
|
<li>
|
||||||
<sec:authorize access="isAuthenticated()">
|
<sec:authorize access="isAuthenticated()">
|
||||||
<sec:authentication property="principal.name" var="userName" />
|
<sec:authentication property="principal.userNm" var="userName" />
|
||||||
<sec:authentication property="principal.id" var="userId" />
|
<sec:authentication property="principal.loginUserId" var="userId" />
|
||||||
${userName}님 (${userId})
|
${userName}님 (${userId})
|
||||||
</sec:authorize>
|
</sec:authorize>
|
||||||
<sec:authorize access="not isAuthenticated()">
|
<sec:authorize access="not isAuthenticated()">
|
||||||
|
|||||||
@ -46,6 +46,11 @@
|
|||||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||||
</listener>
|
</listener>
|
||||||
|
|
||||||
|
<!-- 지방문화원 세션 처리를 위한 세션 리스너 : 2021.08.23 KKN -->
|
||||||
|
<listener>
|
||||||
|
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||||
|
</listener>
|
||||||
|
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>action</servlet-name>
|
<servlet-name>action</servlet-name>
|
||||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||||
|
|||||||
45
src/main/webapp/homes/mapo.jsp
Normal file
45
src/main/webapp/homes/mapo.jsp
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||||
|
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %>
|
||||||
|
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
|
||||||
|
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>마포 문화원</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<h1>마포 문화원</h1>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
JSESSIONID = <%=session.getId() %>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<h2>로그인</h2>
|
||||||
|
<a href="/nlib/login/loginDept.do">로그인</a>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<h2>로그인이 필요한 화면 링크</h2>
|
||||||
|
<a href="/nlib/system/reloadProperties.do">프로퍼티갱신</a>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
51
src/main/webapp/homes/seoul.jsp
Normal file
51
src/main/webapp/homes/seoul.jsp
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||||
|
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %>
|
||||||
|
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>서울 문화원</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<h1>서울 문화원</h1>
|
||||||
|
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
JSESSIONID = <%=session.getId() %>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<h2>로그인</h2>
|
||||||
|
<a href="/nlib/login/loginDept.do">로그인</a>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<h2>로그인이 필요한 화면 링크</h2>
|
||||||
|
<a href="/nlib/system/reloadProperties.do">프로퍼티갱신</a>
|
||||||
|
|
||||||
|
<%
|
||||||
|
String coutTest = "서울특별시 마포구 ";
|
||||||
|
%>
|
||||||
|
<input type="text" name="kkk" value="<c:out value="${'ab c' }" />" /> <br>
|
||||||
|
<input type="text" name="ssssss" value="<c:out value='${"서울특별시 마포구"}' />" />
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -1,2 +1,4 @@
|
|||||||
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
|
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
|
||||||
<jsp:forward page="/index.do"/>
|
|
||||||
|
|
||||||
|
hello
|
||||||
Loading…
Reference in New Issue
Block a user