사용자 DB 테이블 컬럼명 통일화 작업 1차 단순 변경처리 - 중간백업
This commit is contained in:
parent
1a305705ee
commit
eb61153fc1
7
pom.xml
7
pom.xml
@ -191,12 +191,15 @@
|
||||
<artifactId>jackson-dataformat-xml</artifactId>
|
||||
<version>2.9.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- NAVER LOGIN (DIGITALSHIP JSYOO 2021.08.12) -->
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>com.github.scribejava</groupId>
|
||||
<artifactId>scribejava-core</artifactId>
|
||||
<version>2.8.1</version>
|
||||
</dependency>
|
||||
-->
|
||||
<!-- 제이슨 파싱 (DIGITALSHIP JSYOO 2021.08.12)-->
|
||||
<dependency>
|
||||
<groupId>com.googlecode.json-simple</groupId>
|
||||
@ -214,6 +217,7 @@
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 바코드 ZXing (DIGITALSHIP KNKIM 2021.06.25)-->
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
@ -226,7 +230,7 @@
|
||||
<version>3.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- ajax (DIGITALSHIP JSYOO 2021.07.12)-->
|
||||
<!-- ajax (DIGITALSHIP JSYOO 2021.07.12)
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
@ -237,6 +241,7 @@
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.7.3</version>
|
||||
</dependency>
|
||||
-->
|
||||
|
||||
<!-- Tiles (DIGITALSHIP KNKIM 2021.07.06)-->
|
||||
<dependency>
|
||||
|
||||
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* eGovFrame OAuth
|
||||
* Copyright The eGovFrame Open Community (http://open.egovframe.go.kr)).
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @author 이기하(슈퍼개발자K3)
|
||||
*/
|
||||
package egovframework.com.ext.oauth.service;
|
||||
|
||||
import org.springframework.social.connect.UserProfile;
|
||||
import org.springframework.web.context.request.WebRequest;
|
||||
|
||||
/**
|
||||
* 소셜 계정으로 일반회원 가입을 처리하는 비즈니스 인터페이스 클래스
|
||||
* @author 이기하
|
||||
* @since 2014.10.08
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ----------- -------- ---------------------------
|
||||
* 2014.10.08 이기하 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
public interface EgovSignupService {
|
||||
|
||||
/**
|
||||
* 소셜 계정으로 일반회원 가입을 처리한다
|
||||
* @param UserProfile profile
|
||||
* @param WebRequest request
|
||||
* @param String key
|
||||
* @return String
|
||||
* @exception Exception
|
||||
*/
|
||||
public String signup(UserProfile profile, WebRequest request, String key) throws Exception;
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package egovframework.com.ext.oauth.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.github.scribejava.core.builder.api.DefaultApi20;
|
||||
import com.github.scribejava.core.model.OAuthConstants;
|
||||
import com.github.scribejava.core.model.ParameterList;
|
||||
|
||||
public class KakaoAPI20 extends DefaultApi20 implements OAuthConfig {
|
||||
|
||||
private String apiKey = "";
|
||||
private KakaoAPI20() {
|
||||
}
|
||||
|
||||
private static class InstanceHolder {
|
||||
private static final KakaoAPI20 INSTANCE = new KakaoAPI20();
|
||||
}
|
||||
|
||||
public static KakaoAPI20 instance() {
|
||||
return InstanceHolder.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAccessTokenEndpoint() {
|
||||
return KAKAO_ACCESS_TOKEN+apiKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getAuthorizationBaseUrl() {
|
||||
return KAKAO_AUTH;
|
||||
}
|
||||
|
||||
public String getAuthorizationUrl(String responseType, String apiKey, String callback, String scope, String state,
|
||||
Map<String, String> additionalParams) {
|
||||
this.apiKey = apiKey;
|
||||
final ParameterList parameters = new ParameterList(additionalParams);
|
||||
parameters.add(OAuthConstants.RESPONSE_TYPE, responseType);
|
||||
parameters.add(OAuthConstants.CLIENT_ID, apiKey);
|
||||
|
||||
if (callback != null) {
|
||||
parameters.add(OAuthConstants.REDIRECT_URI, callback);
|
||||
}
|
||||
|
||||
if (scope != null) {
|
||||
parameters.add(OAuthConstants.SCOPE, scope);
|
||||
}
|
||||
|
||||
if (state != null) {
|
||||
parameters.add(OAuthConstants.STATE, state);
|
||||
}
|
||||
//System.out.println("===>>> "+parameters.appendTo(""));
|
||||
return parameters.appendTo(getAuthorizationBaseUrl());
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package egovframework.com.ext.oauth.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.github.scribejava.core.builder.api.DefaultApi20;
|
||||
import com.github.scribejava.core.model.OAuthConstants;
|
||||
import com.github.scribejava.core.model.ParameterList;
|
||||
|
||||
public class NaverAPI20 extends DefaultApi20 implements OAuthConfig {
|
||||
private NaverAPI20() {
|
||||
}
|
||||
|
||||
private static class InstanceHolder {
|
||||
private static final NaverAPI20 INSTANCE = new NaverAPI20();
|
||||
}
|
||||
|
||||
public static NaverAPI20 instance() {
|
||||
return InstanceHolder.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAccessTokenEndpoint() {
|
||||
return NAVER_ACCESS_TOKEN;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getAuthorizationBaseUrl() {
|
||||
return NAVER_AUTH;
|
||||
}
|
||||
|
||||
public String getAuthorizationUrl(String responseType, String apiKey, String callback, String scope, String state,
|
||||
Map<String, String> additionalParams) {
|
||||
final ParameterList parameters = new ParameterList(additionalParams);
|
||||
parameters.add(OAuthConstants.RESPONSE_TYPE, responseType);
|
||||
parameters.add(OAuthConstants.CLIENT_ID, apiKey);
|
||||
|
||||
if (callback != null) {
|
||||
parameters.add(OAuthConstants.REDIRECT_URI, callback);
|
||||
}
|
||||
|
||||
if (scope != null) {
|
||||
parameters.add(OAuthConstants.SCOPE, scope);
|
||||
}
|
||||
|
||||
if (state != null) {
|
||||
parameters.add(OAuthConstants.STATE, state);
|
||||
}
|
||||
//System.out.println("===>>> "+parameters.appendTo(""));
|
||||
return parameters.appendTo(getAuthorizationBaseUrl());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package egovframework.com.ext.oauth.service;
|
||||
|
||||
public interface OAuthConfig {
|
||||
|
||||
static final String GOOGLE_PROFILE_URL = "https://www.googleapis.com/plus/v1/people/me";
|
||||
static final String NAVER_PROFILE_URL = "https://openapi.naver.com/v1/nid/me";
|
||||
static final String KAKAO_PROFILE_URL = "https://kapi.kakao.com/v2/user/me";
|
||||
|
||||
static final String NAVER_ACCESS_TOKEN = "https://nid.naver.com/oauth2.0/token?grant_type=authorization_code";
|
||||
static final String NAVER_AUTH = "https://nid.naver.com/oauth2.0/authorize";
|
||||
|
||||
static final String KAKAO_ACCESS_TOKEN = "https://kauth.kakao.com/oauth/token?client_id=";
|
||||
static final String KAKAO_AUTH = "https://kauth.kakao.com/oauth/authorize";
|
||||
|
||||
static final String GOOGLE_SERVICE_NAME = "google";
|
||||
static final String NAVER_SERVICE_NAME = "naver";
|
||||
static final String KAKAO_SERVICE_NAME = "kakao";
|
||||
}
|
||||
@ -0,0 +1,91 @@
|
||||
package egovframework.com.ext.oauth.service;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.github.scribejava.core.builder.ServiceBuilder;
|
||||
import com.github.scribejava.core.model.OAuth2AccessToken;
|
||||
import com.github.scribejava.core.model.OAuthRequest;
|
||||
import com.github.scribejava.core.model.Response;
|
||||
import com.github.scribejava.core.model.Verb;
|
||||
import com.github.scribejava.core.oauth.OAuth20Service;
|
||||
|
||||
|
||||
public class OAuthLogin {
|
||||
private OAuth20Service oauthService;
|
||||
private OAuthVO oauthVO;
|
||||
|
||||
public OAuthLogin(OAuthVO oauthVO) {
|
||||
this.oauthService = new ServiceBuilder(oauthVO.getClientId())
|
||||
.apiSecret(oauthVO.getClientSecret())
|
||||
.callback(oauthVO.getRedirectUrl())
|
||||
.scope("profile")
|
||||
.build(oauthVO.getApi20Instance());
|
||||
|
||||
this.oauthVO = oauthVO;
|
||||
}
|
||||
|
||||
public String getOAuthURL() {
|
||||
return this.oauthService.getAuthorizationUrl();
|
||||
}
|
||||
|
||||
public OAuthUniversalUser getUserProfile(String code) throws Exception {
|
||||
//System.out.println("===>>> oauthService.getApiKey() = "+oauthService.getApiKey());
|
||||
//System.out.println("===>>> oauthService.getApiSecret() = "+oauthService.getApiSecret());
|
||||
OAuth2AccessToken accessToken = oauthService.getAccessToken(code);
|
||||
|
||||
OAuthRequest request = new OAuthRequest(Verb.GET, this.oauthVO.getProfileUrl());
|
||||
oauthService.signRequest(accessToken, request);
|
||||
|
||||
Response response = oauthService.execute(request);
|
||||
return parseJson(response.getBody());
|
||||
}
|
||||
|
||||
private OAuthUniversalUser parseJson(String body) throws Exception {
|
||||
//System.out.println("============================\n" + body + "\n==================");
|
||||
OAuthUniversalUser user = new OAuthUniversalUser();
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode rootNode = mapper.readTree(body);
|
||||
|
||||
if (this.oauthVO.isGoogle()) {
|
||||
String id = rootNode.get("id").asText();
|
||||
user.setServiceName(OAuthConfig.GOOGLE_SERVICE_NAME);
|
||||
if (oauthVO.isGoogle())
|
||||
user.setUserId(id);
|
||||
user.setNickName(rootNode.get("displayName").asText());
|
||||
JsonNode nameNode = rootNode.path("name");
|
||||
String uname = nameNode.get("familyName").asText() + nameNode.get("givenName").asText();
|
||||
user.setUserName(uname);
|
||||
|
||||
Iterator<JsonNode> iterEmails = rootNode.path("emails").elements();
|
||||
while(iterEmails.hasNext()) {
|
||||
JsonNode emailNode = iterEmails.next();
|
||||
String type = emailNode.get("type").asText();
|
||||
if (StringUtils.equals(type, "account")) {
|
||||
user.setEmail(emailNode.get("value").asText());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (this.oauthVO.isNaver()) {
|
||||
user.setServiceName(OAuthConfig.NAVER_SERVICE_NAME);
|
||||
JsonNode resNode = rootNode.get("response");
|
||||
user.setUserId(resNode.get("id").asText());
|
||||
user.setNickName(resNode.get("nickname").asText());
|
||||
user.setEmail(resNode.get("email").asText());
|
||||
|
||||
} else if (this.oauthVO.isKakao()) {
|
||||
user.setServiceName(OAuthConfig.KAKAO_SERVICE_NAME);
|
||||
JsonNode resNode = rootNode.get("properties");
|
||||
user.setUserId(rootNode.get("id").asText());
|
||||
user.setNickName(resNode.get("nickname").asText());
|
||||
}
|
||||
|
||||
return user;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
package egovframework.com.ext.oauth.service;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class OAuthUniversalUser {
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getNickName() {
|
||||
return nickName;
|
||||
}
|
||||
|
||||
public void setNickName(String nickName) {
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public String getServiceName() {
|
||||
return serviceName;
|
||||
}
|
||||
|
||||
public void setServiceName(String serviceName) {
|
||||
this.serviceName = serviceName;
|
||||
}
|
||||
|
||||
public String getLoginip() {
|
||||
return loginIp;
|
||||
}
|
||||
|
||||
public void setLoginip(String loginIp) {
|
||||
this.loginIp = loginIp;
|
||||
}
|
||||
|
||||
public Date getLastlogin() {
|
||||
return lastLogin;
|
||||
}
|
||||
|
||||
public void setLastlogin(Date lastLogin) {
|
||||
this.lastLogin = lastLogin;
|
||||
}
|
||||
|
||||
private String uid;
|
||||
|
||||
private String email;
|
||||
private String userId;
|
||||
private String userName;
|
||||
private String nickName;
|
||||
|
||||
private String serviceName;
|
||||
|
||||
private String loginIp;
|
||||
private Date lastLogin;
|
||||
|
||||
}
|
||||
114
src/main/java/egovframework/com/ext/oauth/service/OAuthVO.java
Normal file
114
src/main/java/egovframework/com/ext/oauth/service/OAuthVO.java
Normal file
@ -0,0 +1,114 @@
|
||||
package egovframework.com.ext.oauth.service;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.github.scribejava.apis.GoogleApi20;
|
||||
import com.github.scribejava.core.builder.api.DefaultApi20;
|
||||
|
||||
public class OAuthVO implements OAuthConfig {
|
||||
public String getService() {
|
||||
return serviceName;
|
||||
}
|
||||
|
||||
public void setService(String service) {
|
||||
this.serviceName = service;
|
||||
}
|
||||
|
||||
public String getClientId() {
|
||||
return clientId;
|
||||
}
|
||||
|
||||
public void setClientId(String clientId) {
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
public String getClientSecret() {
|
||||
return clientSecret;
|
||||
}
|
||||
|
||||
public void setClientSecret(String clientSecret) {
|
||||
this.clientSecret = clientSecret;
|
||||
}
|
||||
|
||||
public String getRedirectUrl() {
|
||||
return redirectUrl;
|
||||
}
|
||||
|
||||
public void setRedirectUrl(String redirectUrl) {
|
||||
this.redirectUrl = redirectUrl;
|
||||
}
|
||||
|
||||
public DefaultApi20 getApi20Instance() {
|
||||
return api20Instance;
|
||||
}
|
||||
|
||||
public void setApi20Instance(DefaultApi20 api20Instance) {
|
||||
this.api20Instance = api20Instance;
|
||||
}
|
||||
|
||||
public String getProfileUrl() {
|
||||
return profileUrl;
|
||||
}
|
||||
|
||||
public void setProfileUrl(String profileUrl) {
|
||||
this.profileUrl = profileUrl;
|
||||
}
|
||||
|
||||
public boolean isGoogle() {
|
||||
return isGoogle;
|
||||
}
|
||||
|
||||
public boolean isNaver() {
|
||||
return isNaver;
|
||||
}
|
||||
|
||||
public boolean isKakao() {
|
||||
return isKakao;
|
||||
}
|
||||
|
||||
public void setGoogle(boolean isGoogle) {
|
||||
this.isGoogle = isGoogle;
|
||||
}
|
||||
|
||||
public void setNaver(boolean isNaver) {
|
||||
this.isNaver = isNaver;
|
||||
}
|
||||
|
||||
public void setKakao(boolean isKakao) {
|
||||
this.isKakao = isKakao;
|
||||
}
|
||||
|
||||
private String serviceName;
|
||||
private String clientId;
|
||||
private String clientSecret;
|
||||
private String redirectUrl;
|
||||
private DefaultApi20 api20Instance;
|
||||
private String profileUrl;
|
||||
|
||||
private boolean isNaver;
|
||||
private boolean isGoogle;
|
||||
private boolean isKakao;
|
||||
|
||||
public OAuthVO(String serviceName, String clientId, String clientSecret, String redirectUrl) {
|
||||
this.serviceName = serviceName;
|
||||
this.clientId = clientId;
|
||||
this.clientSecret = clientSecret;
|
||||
this.redirectUrl = redirectUrl;
|
||||
|
||||
this.isGoogle = StringUtils.equalsIgnoreCase(GOOGLE_SERVICE_NAME, serviceName);
|
||||
this.isNaver = StringUtils.equalsIgnoreCase(NAVER_SERVICE_NAME, serviceName);
|
||||
this.isKakao = StringUtils.equalsIgnoreCase(KAKAO_SERVICE_NAME, serviceName);
|
||||
|
||||
if (isGoogle) {
|
||||
this.api20Instance = GoogleApi20.instance();
|
||||
this.profileUrl = GOOGLE_PROFILE_URL;
|
||||
} else if (isNaver) {
|
||||
this.api20Instance = NaverAPI20.instance();
|
||||
this.profileUrl = NAVER_PROFILE_URL;
|
||||
} else if (isKakao) {
|
||||
this.api20Instance = KakaoAPI20.instance();
|
||||
this.profileUrl = KAKAO_PROFILE_URL;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,171 @@
|
||||
/*
|
||||
* eGovFrame OAuth
|
||||
* Copyright The eGovFrame Open Community (http://open.egovframe.go.kr)).
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @author 이기하(슈퍼개발자K3)
|
||||
*/
|
||||
package egovframework.com.ext.oauth.web;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.inject.Inject;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.social.connect.Connection;
|
||||
import org.springframework.social.connect.ConnectionFactoryLocator;
|
||||
import org.springframework.social.connect.UserProfile;
|
||||
import org.springframework.social.connect.UsersConnectionRepository;
|
||||
import org.springframework.social.connect.web.ProviderSignInUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.context.request.WebRequest;
|
||||
|
||||
//import egovframework.com.ext.oauth.service.EgovSignupService;
|
||||
import egovframework.com.ext.oauth.service.OAuthConfig;
|
||||
import egovframework.com.ext.oauth.service.OAuthLogin;
|
||||
import egovframework.com.ext.oauth.service.OAuthUniversalUser;
|
||||
import egovframework.com.ext.oauth.service.OAuthVO;
|
||||
import egovframework.com.utl.fcc.service.EgovStringUtil;
|
||||
|
||||
/**
|
||||
* 소셜 계정으로 일반회원 가입을 처리하는 컨트롤러 클래스
|
||||
* @author 이기하
|
||||
* @since 2014.10.08
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ----------- -------- ---------------------------
|
||||
* 2014.10.08 이기하 최초 생성
|
||||
* 2018.10.02 신용호 Facebook 관련 ProviderSignInUtils 초기화 수정
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
@Controller
|
||||
public class EgovSignupController {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovSignupController.class);
|
||||
|
||||
|
||||
// TODO 필요여부 확인할 것 DDDDDDDDDDDDDDDDDDDDDDDDD
|
||||
// @Resource(name="signupService")
|
||||
// private EgovSignupService signupService;
|
||||
|
||||
//private ConnectionRepository connectionRepository;
|
||||
//private final ProviderSignInUtils providerSignInUtils;
|
||||
// TODO 필요여부 확인할 것 DDDDDDDDDDDDDDDDDDDDD
|
||||
|
||||
@Inject
|
||||
private OAuthVO naverAuthVO;
|
||||
|
||||
@Inject
|
||||
private OAuthVO googleAuthVO;
|
||||
|
||||
@Inject
|
||||
private OAuthVO kakaoAuthVO;
|
||||
|
||||
|
||||
// TODO : 필요여부 확인할 것 DDDDDDDDDDDDDDDDDD
|
||||
// @Inject
|
||||
// public EgovSignupController(ConnectionFactoryLocator connectionFactoryLocator,UsersConnectionRepository connectionRepository) {
|
||||
// //this.providerSignInUtils = new ProviderSignInUtils();
|
||||
// this.providerSignInUtils = new ProviderSignInUtils(connectionFactoryLocator, connectionRepository);
|
||||
// }
|
||||
//
|
||||
// @RequestMapping(value="/signup", method=RequestMethod.GET)
|
||||
// public String signupForm(WebRequest request) throws Exception {
|
||||
// Connection<?> connection = providerSignInUtils.getConnectionFromSession(request);
|
||||
// if (connection != null) {
|
||||
// UserProfile profile = connection.fetchUserProfile();
|
||||
//
|
||||
// String key = EgovStringUtil.remove(connection.getKey().toString(), ':');
|
||||
// String account = signupService.signup(profile, request, key);
|
||||
// if (account != null) {
|
||||
// providerSignInUtils.doPostSignUp(key, request);
|
||||
// return "redirect:/";
|
||||
// }
|
||||
// }
|
||||
// return "redirect:/";
|
||||
// }
|
||||
|
||||
@RequestMapping(value = "/uat/uia/oauthLoginUsr", method = RequestMethod.GET)
|
||||
public String login(Model model) throws Exception {
|
||||
LOGGER.debug("===>>> OAuth Login .....");
|
||||
|
||||
OAuthLogin naverLogin = new OAuthLogin(naverAuthVO);
|
||||
LOGGER.debug("naverLogin.getOAuthURL() = "+naverLogin.getOAuthURL());
|
||||
model.addAttribute("naver_url", naverLogin.getOAuthURL());
|
||||
|
||||
OAuthLogin googleLogin = new OAuthLogin(googleAuthVO);
|
||||
LOGGER.debug("googleLogin.getOAuthURL() = "+googleLogin.getOAuthURL());
|
||||
model.addAttribute("google_url", googleLogin.getOAuthURL());
|
||||
|
||||
OAuthLogin kakaoLogin = new OAuthLogin(kakaoAuthVO);
|
||||
LOGGER.debug("kakaoLogin.getOAuthURL() = "+kakaoLogin.getOAuthURL());
|
||||
model.addAttribute("kakao_url", kakaoLogin.getOAuthURL());
|
||||
|
||||
return "egovframework/com/uat/uia/EgovLoginUsrOauth";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/auth/{oauthService}/callback",
|
||||
method = { RequestMethod.GET, RequestMethod.POST})
|
||||
public String oauthLoginCallback(@PathVariable String oauthService,
|
||||
Model model, @RequestParam String code, HttpSession session) throws Exception {
|
||||
|
||||
LOGGER.debug("oauthLoginCallback: service={}", oauthService);
|
||||
LOGGER.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
|
||||
oauthVO = kakaoAuthVO;
|
||||
|
||||
// 1. code를 이용해서 Access Token 받기
|
||||
// 2. Access Token을 이용해서 사용자 제공정보 가져오기
|
||||
OAuthLogin oauthLogin = new OAuthLogin(oauthVO);
|
||||
|
||||
OAuthUniversalUser oauthUser = oauthLogin.getUserProfile(code); // 1,2번 동시
|
||||
LOGGER.debug("Profile ===>>" + oauthUser);
|
||||
|
||||
// ========================================================================
|
||||
// 다음 부분은 업무의 목적에 맞게 커스텀 코드를 작성한다.
|
||||
// 3. 해당 유저가 DB에 존재하는지 체크 (google, naver, kakao에서 전달받은 ID가 존재하는지 체크)
|
||||
String resultDBInfo = ""; // DB 체크 결과
|
||||
|
||||
if ( oauthUser == null || resultDBInfo == null) {
|
||||
// 미존재시 가입페이지로!!
|
||||
model.addAttribute("message", "This user does not exist. Please sign up.");
|
||||
|
||||
} else {
|
||||
// 존재시 로그인 처리
|
||||
model.addAttribute("message", "OAuth Sign-in succeeded.");
|
||||
|
||||
}
|
||||
|
||||
return "egovframework/com/uat/uia/EgovLoginUsrOauthResult";
|
||||
}
|
||||
|
||||
}
|
||||
@ -465,7 +465,7 @@ public class BoardController extends NlibCommonController
|
||||
addParamsToModel(paramMap, model);
|
||||
|
||||
NlibLoginVO loginVO = getNlibLoginVO(authentication);
|
||||
if(StringUtil.isEmpty(paramMap.get("regUserName"))) model.addAttribute("regUserName", loginVO.getName());
|
||||
if(StringUtil.isEmpty(paramMap.get("regUserName"))) model.addAttribute("regUserName", loginVO.getUserNm());
|
||||
if(StringUtil.isEmpty(paramMap.get("email"))) model.addAttribute("regUserName", loginVO.getEmail());
|
||||
|
||||
return "nlib/board/insertQnAForm";
|
||||
|
||||
@ -99,7 +99,7 @@ public class NlibCommonController {
|
||||
String authKey = null;
|
||||
|
||||
if(authentication != null) {
|
||||
userId = ((NlibLoginVO)authentication.getPrincipal()).getId();
|
||||
userId = ((NlibLoginVO)authentication.getPrincipal()).getUserId();
|
||||
}
|
||||
|
||||
if(nlib.util.StringUtil.isEmpty(userId)) {
|
||||
|
||||
@ -127,7 +127,7 @@ public class QRCodeUtil {
|
||||
throw new Exception("QR 2D바코드로 생성할 사용자 정보가 없습니다.");
|
||||
}
|
||||
|
||||
if(StringUtil.isEmpty(loginVO.getUniqId())) {
|
||||
if(StringUtil.isEmpty(loginVO.getUserId())) {
|
||||
throw new Exception("QR 2D바코드로 생성에 필요한 사용자고유번호 정보가 없습니다.");
|
||||
}
|
||||
|
||||
@ -135,21 +135,21 @@ public class QRCodeUtil {
|
||||
throw new Exception("QR 2D바코드로 생성에 필요한 이메일 정보가 없습니다.");
|
||||
}
|
||||
|
||||
if(StringUtil.isEmpty(loginVO.getName())) {
|
||||
if(StringUtil.isEmpty(loginVO.getUserNm())) {
|
||||
throw new Exception("QR 2D바코드로 생성에 필요한 이름 정보가 없습니다.");
|
||||
}
|
||||
|
||||
// (1) "사용자고유번호;이메일;이름;" 형식으로 문자열을 구성
|
||||
String barcodeText = String.format("%s;%s;%s;"
|
||||
, loginVO.getUniqId()
|
||||
, loginVO.getUserId()
|
||||
, loginVO.getEmail()
|
||||
, loginVO.getName());
|
||||
, loginVO.getUserNm());
|
||||
log.debug("generateMemberQRCodeImage : barcodeText=" + barcodeText);
|
||||
|
||||
// (2) 앞의 (1)의 문자열을 암호화 처리
|
||||
String cryptedBarcodeText = EgovFileScrty.encodeBinary(barcodeText.getBytes());
|
||||
log.debug("generateMemberQRCodeImage : cryptedBarcodeText=" + cryptedBarcodeText);
|
||||
loginVO.setDn(cryptedBarcodeText);
|
||||
loginVO.setOnnaraUserid(cryptedBarcodeText); // TODO 임시저장처리 DDDDDDDDDDDDDDDDDDDDDDD
|
||||
|
||||
// (3) 앞의 (2) 암호화 문자열로 QRCode 생성하여 BufferedImage형식으로 리턴
|
||||
return generateQRCodeImageByZxing(cryptedBarcodeText);
|
||||
@ -181,9 +181,9 @@ public class QRCodeUtil {
|
||||
|
||||
NlibLoginVO info = new NlibLoginVO();
|
||||
|
||||
info.setUniqId(split[0]);
|
||||
info.setUserId(split[0]);
|
||||
info.setEmail(split[1]);
|
||||
info.setName(split[2]);
|
||||
info.setUserNm(split[2]);
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
@ -47,9 +47,9 @@ public class BarcodeController {
|
||||
|
||||
log.debug("getMemberQRCodeForm : loginVO=" + loginVO.toString());
|
||||
|
||||
if(StringUtil.isEmpty(loginVO.getUniqId())) loginVO.setUniqId("USER0001-000001");
|
||||
if(StringUtil.isEmpty(loginVO.getUserId())) loginVO.setUserId("USER0001-000001");
|
||||
if(StringUtil.isEmpty(loginVO.getEmail())) loginVO.setEmail("myid@digitalship.co.kr");
|
||||
if(StringUtil.isEmpty(loginVO.getName())) loginVO.setName("홍길동");
|
||||
if(StringUtil.isEmpty(loginVO.getUserNm())) loginVO.setUserNm("홍길동");
|
||||
|
||||
model.addAttribute("loginVO", loginVO);
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import nlib.restful.DataApi;
|
||||
import egovframework.rte.psl.dataaccess.EgovAbstractMapper;
|
||||
import nlib.restful.service.DataApiReqVO;
|
||||
import nlib.restful.service.DataApiResVO;
|
||||
import nlib.util.StringUtil;
|
||||
@ -27,6 +27,7 @@ import nlib.util.StringUtil;
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 2021. 7. 9. KNKIM 최초 생성
|
||||
* @ 2021.08.13. KNKIM RESTfulAPI -> DB직접 접근 방식으로 변경
|
||||
*
|
||||
*
|
||||
* @author 이씨플라자 * DIGITALSHIP KNKIM
|
||||
@ -35,26 +36,20 @@ import nlib.util.StringUtil;
|
||||
*
|
||||
*/
|
||||
@Repository("secUserDAO")
|
||||
public class SecUserDAO extends DataApi {
|
||||
public class SecUserDAO extends EgovAbstractMapper {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(SecUserDAO.class);
|
||||
|
||||
public static final String RESOURCE_URI = "/user/sec/login";
|
||||
|
||||
public SecUserVO loadUserByUsername(DataApiReqVO reqVO) {
|
||||
public SecUserVO loadUserByUsername(String userName) {
|
||||
|
||||
HashMap<String, String> info = selectOne("secUserDAO.loadUserByUsername", userName);
|
||||
|
||||
// URI가 다른 경우, 해당 URI 설정
|
||||
reqVO.setReqUrl(RESOURCE_URI);
|
||||
|
||||
DataApiResVO resVO = get(reqVO);
|
||||
HashMap<String, Object> info = resVO.getInfo();
|
||||
|
||||
// 사용자 정보 담기
|
||||
SecUserVO ret = new SecUserVO();
|
||||
ret.setId ((String)info.get("userId"));
|
||||
ret.setName ((String)info.get("userName"));
|
||||
ret.setPassword ((String)info.get("password"));
|
||||
ret.setUniqId ((String)info.get("uniqId"));
|
||||
ret.setUserId ((String)info.get("userId"));
|
||||
ret.setUserNm ((String)info.get("userName"));
|
||||
ret.setUserPwd ((String)info.get("userPwd"));
|
||||
ret.setLoginUserId ((String)info.get("loginUserId"));
|
||||
|
||||
// 다중 권한 설정
|
||||
String authorities = (String)info.get("authorities");
|
||||
@ -66,4 +61,5 @@ public class SecUserDAO extends DataApi {
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -54,16 +54,7 @@ public class SecUserDetailsService implements UserDetailsService {
|
||||
@Override
|
||||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
||||
|
||||
DataApiReqVO reqVO = new DataApiReqVO();
|
||||
reqVO.setAuthKey("NONE");
|
||||
reqVO.setPageIndex("1");
|
||||
reqVO.setPageSize("1");
|
||||
|
||||
HashMap<String, Object> info = new HashMap<String, Object>();
|
||||
info.put("id", username);
|
||||
reqVO.setInfo(info);
|
||||
|
||||
SecUserVO secUserVO = secUserDAO.loadUserByUsername(reqVO);
|
||||
SecUserVO secUserVO = secUserDAO.loadUserByUsername(username);
|
||||
|
||||
if(secUserVO == null) {
|
||||
throw new UsernameNotFoundException(username);
|
||||
|
||||
@ -7,7 +7,7 @@ import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import nlib.user.service.NlibLoginVO;
|
||||
import nlib.user.service.UserInfoVO;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
@ -31,7 +31,7 @@ import nlib.user.service.NlibLoginVO;
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class SecUserVO extends NlibLoginVO implements UserDetails {
|
||||
public class SecUserVO extends UserInfoVO implements UserDetails {
|
||||
|
||||
private static final long serialVersionUID = -8274004534207618048L;
|
||||
|
||||
@ -39,7 +39,7 @@ public class SecUserVO extends NlibLoginVO implements UserDetails {
|
||||
public static final String ROLE_ADMIN = "ROLE_ADMIN";
|
||||
public static final String DEFAULT_ROLE = ROLE_USER;
|
||||
|
||||
ArrayList<GrantedAuthority> auth = null;
|
||||
ArrayList<GrantedAuthority> auth = null; /* 권한 목록 */
|
||||
|
||||
public void addAuthority(String authName) {
|
||||
if(auth == null) auth = new ArrayList<GrantedAuthority>();
|
||||
@ -62,16 +62,16 @@ public class SecUserVO extends NlibLoginVO implements UserDetails {
|
||||
*/
|
||||
@Override
|
||||
public String getPassword() {
|
||||
return super.getPassword();
|
||||
return super.getUserPwd();
|
||||
}
|
||||
|
||||
/* 계정의 이름을 리턴한다. (사용자ID:email)
|
||||
/* 계정의 이름을 리턴한다. (사용자ID:email형식의 LOGIN_USER_ID 정보)
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.security.core.userdetails.UserDetails#getUsername()
|
||||
*/
|
||||
@Override
|
||||
public String getUsername() {
|
||||
return super.getId();
|
||||
return super.getLoginUserId();
|
||||
}
|
||||
|
||||
/* 계정이 만료되지 않았는 지 여부를 리턴한다. (true: 만료안됨)
|
||||
@ -92,7 +92,7 @@ public class SecUserVO extends NlibLoginVO implements UserDetails {
|
||||
@Override
|
||||
public boolean isAccountNonLocked() {
|
||||
|
||||
// TODO : 계정잠금 기능 사용안함으로 임시 처리. 추후 구현 필요
|
||||
// SNS 로그인만 허용하므로, 별도 계정 LOCK 기능 불필요
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -58,6 +58,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
.antMatchers("/inform/**")
|
||||
.antMatchers("/alert/**")
|
||||
.antMatchers("/code/**")
|
||||
.antMatchers("/**")
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
330
src/main/java/nlib/user/service/UserInfoVO.java
Normal file
330
src/main/java/nlib/user/service/UserInfoVO.java
Normal file
@ -0,0 +1,330 @@
|
||||
package nlib.user.service;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* @Class Name : UserInfoVO.java
|
||||
*
|
||||
* @Description : 사용자정보 VO 클래스
|
||||
*
|
||||
*
|
||||
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 2021. 8. 13. KNKIM 최초 생성
|
||||
*
|
||||
*
|
||||
* @author 이씨플라자 * DIGITALSHIP KNKIM
|
||||
* @since 2021. 8. 13.
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
public class UserInfoVO {
|
||||
|
||||
private String userId; /* 사용자아이디 (ex: U1000000001) */
|
||||
private String loginUserId; /* 로그인사용자ID (이메일주소) */
|
||||
private String deptSeq; /* 조직코드 */
|
||||
private String userDiv; /* 사용자구분 */
|
||||
private String userNm; /* 사용자명 */
|
||||
private String userPwd; /* 비밀번호 */
|
||||
private String posNm; /* 직위 */
|
||||
private String rank; /* 직급 */
|
||||
private String workFlag; /* 근무여부 */
|
||||
private String telNo; /* 전화번호 */
|
||||
private String zipcode; /* 우편번호 */
|
||||
private String addr1; /* 주소1 */
|
||||
private String addr2; /* 주소2 */
|
||||
private String strtMenuSeq; /* 시작페이지 */
|
||||
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 regDd; /* 등록일자 */
|
||||
private String modId; /* 수정자 */
|
||||
private String modDd; /* 수정일자 */
|
||||
private String email; /* 이메일 */
|
||||
private String mobileNo; /* 모바일 */
|
||||
private String websiteAddr; /* 웹사이트 */
|
||||
private String facebookId; /* 페이스북아이디 */
|
||||
private String twitterId; /* 트위터아이디 */
|
||||
private String googleId; /* 구글플러스아이디 */
|
||||
private String boardRowCnt; /* 글목록수 */
|
||||
|
||||
private String authKey; /* 로그인 인증키 */
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// SETTER.GETTER
|
||||
//----------------------------------------------------------------
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getLoginUserId() {
|
||||
return loginUserId;
|
||||
}
|
||||
|
||||
public void setLoginUserId(String loginUserId) {
|
||||
this.loginUserId = loginUserId;
|
||||
}
|
||||
|
||||
public String getDeptSeq() {
|
||||
return deptSeq;
|
||||
}
|
||||
|
||||
public void setDeptSeq(String deptSeq) {
|
||||
this.deptSeq = deptSeq;
|
||||
}
|
||||
|
||||
public String getUserDiv() {
|
||||
return userDiv;
|
||||
}
|
||||
|
||||
public void setUserDiv(String userDiv) {
|
||||
this.userDiv = userDiv;
|
||||
}
|
||||
|
||||
public String getUserNm() {
|
||||
return userNm;
|
||||
}
|
||||
|
||||
public void setUserNm(String userNm) {
|
||||
this.userNm = userNm;
|
||||
}
|
||||
|
||||
public String getUserPwd() {
|
||||
return userPwd;
|
||||
}
|
||||
|
||||
public void setUserPwd(String 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() {
|
||||
return telNo;
|
||||
}
|
||||
|
||||
public void setTelNo(String telNo) {
|
||||
this.telNo = telNo;
|
||||
}
|
||||
|
||||
public String getZipcode() {
|
||||
return zipcode;
|
||||
}
|
||||
|
||||
public void setZipcode(String zipcode) {
|
||||
this.zipcode = zipcode;
|
||||
}
|
||||
|
||||
public String getAddr1() {
|
||||
return addr1;
|
||||
}
|
||||
|
||||
public void setAddr1(String addr1) {
|
||||
this.addr1 = addr1;
|
||||
}
|
||||
|
||||
public String getAddr2() {
|
||||
return addr2;
|
||||
}
|
||||
|
||||
public void setAddr2(String addr2) {
|
||||
this.addr2 = addr2;
|
||||
}
|
||||
|
||||
public String getStrtMenuSeq() {
|
||||
return strtMenuSeq;
|
||||
}
|
||||
|
||||
public void setStrtMenuSeq(String strtMenuSeq) {
|
||||
this.strtMenuSeq = strtMenuSeq;
|
||||
}
|
||||
|
||||
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() {
|
||||
return regId;
|
||||
}
|
||||
|
||||
public void setRegId(String regId) {
|
||||
this.regId = regId;
|
||||
}
|
||||
|
||||
public String getRegDd() {
|
||||
return regDd;
|
||||
}
|
||||
|
||||
public void setRegDd(String regDd) {
|
||||
this.regDd = regDd;
|
||||
}
|
||||
|
||||
public String getModId() {
|
||||
return modId;
|
||||
}
|
||||
|
||||
public void setModId(String modId) {
|
||||
this.modId = modId;
|
||||
}
|
||||
|
||||
public String getModDd() {
|
||||
return modDd;
|
||||
}
|
||||
|
||||
public void setModDd(String modDd) {
|
||||
this.modDd = modDd;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getMobileNo() {
|
||||
return mobileNo;
|
||||
}
|
||||
|
||||
public void setMobileNo(String 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -174,7 +174,7 @@ public class MemberController {
|
||||
|
||||
if(flashMap != null)
|
||||
{
|
||||
vo.setId(String.valueOf(flashMap.get("email")));
|
||||
vo.setLoginUserId(String.valueOf(flashMap.get("email")));
|
||||
}else {
|
||||
return "forward:/member/selectMemberJoiningInfo.do";
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ public class userInfoController {
|
||||
SecUserVO vo=(SecUserVO) authentication.getPrincipal();
|
||||
|
||||
HashMap map = new HashMap();
|
||||
map.put("id", vo.getId());
|
||||
map.put("id", vo.getUserId());
|
||||
|
||||
//회원 ID로 회원의 정보를 조회해온다.
|
||||
DataApiReqVO reqvo=new DataApiReqVO();
|
||||
|
||||
@ -6,7 +6,10 @@
|
||||
|
||||
<aop:config>
|
||||
<aop:pointcut id="serviceMethod" expression="execution(* egovframework..impl.*Impl.*(..)) or
|
||||
execution(* nlib..impl.*Impl.*(..))" />
|
||||
execution(* nlib..impl.*Impl.*(..)) or
|
||||
execution(* cmm..impl.*Impl.*(..)) or
|
||||
execution(* kccf..impl.*Impl.*(..))
|
||||
" />
|
||||
|
||||
<aop:aspect ref="exceptionTransfer">
|
||||
<aop:after-throwing throwing="exception" pointcut-ref="serviceMethod" method="transfer" />
|
||||
|
||||
30
src/main/resources/egovframework/spring/context-oauth.xml
Normal file
30
src/main/resources/egovframework/spring/context-oauth.xml
Normal file
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd">
|
||||
|
||||
<!-- NAVER OAuth Configuration -->
|
||||
<bean id="naverAuthVO" class="egovframework.com.ext.oauth.service.OAuthVO">
|
||||
<constructor-arg value="naver" /><!-- Service Name -->
|
||||
<constructor-arg value="2NUTY4QHkWzCuEA3dNJo" /><!-- naverClientID -->
|
||||
<constructor-arg value="I4UqcbjJbW" /><!-- naverClientSecret -->
|
||||
<constructor-arg value="http://127.0.0.1:8500/auth/naver/callback" /><!-- naverRedirectUrl -->
|
||||
</bean>
|
||||
|
||||
<!-- GOOGLE OAuth Configuration -->
|
||||
<bean id="googleAuthVO" class="egovframework.com.ext.oauth.service.OAuthVO">
|
||||
<constructor-arg value="google" /><!-- Service Name -->
|
||||
<constructor-arg value="1044767185911-oev6uo5pkro2n5u3se4lragkb9o8ipg7.apps.googleusercontent.com" /><!-- googleClientID -->
|
||||
<constructor-arg value="5qAMYyDD9CkN3f38w0a8zomn" /><!-- googleClientSecret -->
|
||||
<constructor-arg value="http://localhost:8500/auth/google/callback" /><!-- googleRedirectUrl -->
|
||||
</bean>
|
||||
|
||||
<!-- KAKAO OAuth Configuration -->
|
||||
<bean id="kakaoAuthVO" class="egovframework.com.ext.oauth.service.OAuthVO">
|
||||
<constructor-arg value="kakao" /><!-- Service Name -->
|
||||
<constructor-arg value="8fc0e5fc8b29f5224f7ee2101c6e3547" /><!-- kakaoClientID -->
|
||||
<constructor-arg value="AGxiWEwu2ytIifA1AY2PoqVSrdnRZiao" /><!-- kakaoClientSecret -->
|
||||
<constructor-arg value="http://localhost:8500/auth/kakao/callback" /><!-- kakaoRedirectUrl -->
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@ -7,7 +7,7 @@
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
|
||||
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
|
||||
|
||||
<context:component-scan base-package="egovframework, nlib">
|
||||
<context:component-scan base-package="egovframework, nlib, kccf, cmm">
|
||||
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
|
||||
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service"/>
|
||||
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Repository"/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user