sns 로그인 수정
This commit is contained in:
parent
c34acf02e5
commit
28401512f2
@ -77,8 +77,8 @@ public class OAuthLogin {
|
||||
this.oauthVO = oauthVO;
|
||||
}
|
||||
|
||||
public String getOAuthURL() {
|
||||
return this.oauthService.getAuthorizationUrl();
|
||||
public String getOAuthURL(String state) {
|
||||
return this.oauthService.getAuthorizationUrl(state);
|
||||
}
|
||||
|
||||
public OAuthUniversalUser getUserProfile(String code) throws Exception {
|
||||
|
||||
@ -12,6 +12,7 @@ public class OAuthVO implements OAuthConfig {
|
||||
private String clientId;
|
||||
private String clientSecret;
|
||||
private String redirectUrl;
|
||||
private String state;
|
||||
private DefaultApi20 api20Instance;
|
||||
private String profileUrl;
|
||||
|
||||
@ -24,7 +25,7 @@ public class OAuthVO implements OAuthConfig {
|
||||
this.clientId = clientId;
|
||||
this.clientSecret = clientSecret;
|
||||
this.redirectUrl = redirectUrl;
|
||||
|
||||
this.state = state;
|
||||
this.isGoogle = StringUtil.equalsIgnoreCase(GOOGLE_SERVICE_NAME, serviceName);
|
||||
this.isNaver = StringUtil.equalsIgnoreCase(NAVER_SERVICE_NAME, serviceName);
|
||||
this.isKakao = StringUtil.equalsIgnoreCase(KAKAO_SERVICE_NAME, serviceName);
|
||||
@ -117,5 +118,13 @@ public class OAuthVO implements OAuthConfig {
|
||||
public void setKakao(boolean isKakao) {
|
||||
this.isKakao = isKakao;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -264,17 +264,18 @@ public class LoginController extends NlibCommonController {
|
||||
//----------------------------------------------
|
||||
// SNS 연동 URL 생성
|
||||
//----------------------------------------------
|
||||
String encCouncilJsessionId = AriaCrypto.encode(councilJsessionId);
|
||||
OAuthLogin naverLogin = new OAuthLogin(naverAuthVO, callType, councilJsessionId);
|
||||
log.debug("naverLogin.getOAuthURL() = "+naverLogin.getOAuthURL());
|
||||
model.addAttribute("naverUrl", naverLogin.getOAuthURL());
|
||||
log.debug("naverLogin.getOAuthURL() = "+naverLogin.getOAuthURL(encCouncilJsessionId));
|
||||
model.addAttribute("naverUrl", naverLogin.getOAuthURL(encCouncilJsessionId));
|
||||
|
||||
OAuthLogin googleLogin = new OAuthLogin(googleAuthVO, callType, councilJsessionId);
|
||||
log.debug("googleLogin.getOAuthURL() = "+googleLogin.getOAuthURL());
|
||||
model.addAttribute("googleUrl", googleLogin.getOAuthURL());
|
||||
log.debug("googleLogin.getOAuthURL() = "+googleLogin.getOAuthURL(encCouncilJsessionId));
|
||||
model.addAttribute("googleUrl", googleLogin.getOAuthURL(encCouncilJsessionId));
|
||||
|
||||
OAuthLogin kakaoLogin = new OAuthLogin(kakaoAuthVO, OAuthLogin.CALL_TYPE_LOGIN, councilJsessionId);
|
||||
log.debug("kakaoLogin.getOAuthURL() = "+kakaoLogin.getOAuthURL());
|
||||
model.addAttribute("kakaoUrl", kakaoLogin.getOAuthURL());
|
||||
log.debug("kakaoLogin.getOAuthURL() = "+kakaoLogin.getOAuthURL(encCouncilJsessionId));
|
||||
model.addAttribute("kakaoUrl", kakaoLogin.getOAuthURL(encCouncilJsessionId));
|
||||
|
||||
model.addAttribute("error", error);
|
||||
model.addAttribute("message", message);
|
||||
@ -316,14 +317,12 @@ public class LoginController extends NlibCommonController {
|
||||
HttpServletRequest req,
|
||||
@PathVariable String callType,
|
||||
@PathVariable String oauthServiceName,
|
||||
@RequestParam(required = false) String councilJsessionId,
|
||||
@RequestParam(required = false) String code,
|
||||
@RequestParam(required = false) String code,
|
||||
@RequestParam(name = "state" , required = false) String councilJsessionId,
|
||||
@RequestParam(required = false) String error,
|
||||
Model model,
|
||||
HttpSession session) throws Exception {
|
||||
|
||||
String redirectUrl = NlibProperty.getString("home.uri"); // "/index.do";
|
||||
|
||||
if(StringUtil.isEmpty(councilJsessionId)) {
|
||||
model.addAttribute("message", "잘못된 접근입니다. (접속문화원 세션정보 오류)");
|
||||
model.addAttribute("loginBtnYn", "Y");
|
||||
@ -331,7 +330,6 @@ public class LoginController extends NlibCommonController {
|
||||
return "nlib/login/loginMessage";
|
||||
}
|
||||
councilJsessionId = AriaCrypto.decode(councilJsessionId);
|
||||
|
||||
OAuthUniversalUser tmpUser = SessionConfig.getLoginInfo(councilJsessionId);
|
||||
if(tmpUser == null || StringUtil.isEmpty(tmpUser.getCouncilHomeUrl())) {
|
||||
model.addAttribute("message", "잘못된 접근입니다. (접속문화원 정보 오류)");
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
<constructor-arg value="naver" /><!-- Service Name -->
|
||||
<constructor-arg value="EUu_FlgfyBlpQwGkXbit" /><!-- naverClientID -->
|
||||
<constructor-arg value="f34KD054kW" /><!-- naverClientSecret -->
|
||||
<constructor-arg value="https://nlib-dev.nculture.org/{callType}/{oauthServiceName}/callback.do?councilJsessionId={councilJsessionId}" /><!-- naverRedirectUrl : callType(login|member) -->
|
||||
<constructor-arg value="https://nlib-dev.nculture.org/{callType}/{oauthServiceName}/callback.do" /><!-- naverRedirectUrl : callType(login|member) -->
|
||||
</bean>
|
||||
|
||||
<!-- GOOGLE OAuth Configuration -->
|
||||
@ -16,7 +16,7 @@
|
||||
<constructor-arg value="google" /><!-- Service Name -->
|
||||
<constructor-arg value="590802608410-a03ul9al205h3h8rvhrlr2tulleftt0o.apps.googleusercontent.com" /><!-- googleClientID -->
|
||||
<constructor-arg value="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" /><!-- googleClientSecret -->
|
||||
<constructor-arg value="https://nlib-dev.nculture.org/{callType}/{oauthServiceName}/callback.do?councilJsessionId={councilJsessionId}" /><!-- googleRedirectUrl : callType(login|member) -->
|
||||
<constructor-arg value="https://nlib-dev.nculture.org/{callType}/{oauthServiceName}/callback.do" /><!-- googleRedirectUrl : callType(login|member) -->
|
||||
</bean>
|
||||
|
||||
<!-- KAKAO OAuth Configuration -->
|
||||
@ -24,7 +24,7 @@
|
||||
<constructor-arg value="kakao" /><!-- Service Name -->
|
||||
<constructor-arg value="9c1b2249240c011edf40a1d487702232" /><!-- kakaoClientID -->
|
||||
<constructor-arg value="fxv4i1aztudvPj84DEUvMTnzWe29611G" /><!-- kakaoClientSecret -->
|
||||
<constructor-arg value="https://nlib-dev.nculture.org/{callType}/{oauthServiceName}/callback.do?councilJsessionId={councilJsessionId}" /><!-- kakaoRedirectUrl : callType(login|member) -->
|
||||
<constructor-arg value="https://nlib-dev.nculture.org/{callType}/{oauthServiceName}/callback.do" /><!-- kakaoRedirectUrl : callType(login|member) -->
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
||||
@ -57,8 +57,8 @@
|
||||
<div class="join-box">
|
||||
<div class="login">
|
||||
<div class="Btn Naver"><button type="button" onclick="location.href='${naverUrl}';">네이버 아이디로 로그인</button></div>
|
||||
<div class="Btn Kakao"><button type="button" onclick="location.href='${googleUrl}';">카카오 로그인</button></div>
|
||||
<div class="Btn Google"><button type="button" onclick="location.href='${kakaoUrl}';">Google 계정으로 로그인</button></div>
|
||||
<div class="Btn Kakao"><button type="button" onclick="location.href='${kakaoUrl}';">카카오 로그인</button></div>
|
||||
<div class="Btn Google"><button type="button" onclick="location.href='${googleUrl}';">Google 계정으로 로그인</button></div>
|
||||
</div>
|
||||
<div class="row Text">
|
||||
<p>로그인할 때 이용할 SNS를 선택하세요!</p>
|
||||
|
||||
@ -46,8 +46,8 @@
|
||||
<div class="inner">
|
||||
<div class="row First">
|
||||
<div class="Btn Naver"><button type="button" onclick="location.href='${naverUrl}';">네이버 아이디로 로그인</button></div>
|
||||
<div class="Btn Kakao"><button type="button" onclick="location.href='${googleUrl}';">카카오 로그인</button></div>
|
||||
<div class="Btn Google"><button type="button" onclick="location.href='${kakaoUrl}';">Google 계정으로 로그인</button></div>
|
||||
<div class="Btn Kakao"><button type="button" onclick="location.href='${kakaoUrl}';">카카오 로그인</button></div>
|
||||
<div class="Btn Google"><button type="button" onclick="location.href='${googleUrl}';">Google 계정으로 로그인</button></div>
|
||||
</div>
|
||||
<div class="row Text">
|
||||
<p>회원가입하고 <span>대출/열람 서비스</span>를 이용해보세요!</p>
|
||||
|
||||
@ -63,8 +63,8 @@
|
||||
</div>
|
||||
<div class="login">
|
||||
<div class="Btn Naver"><button type="button" onclick="location.href='${naverUrl}';">네이버로 간편 가입</button></div>
|
||||
<div class="Btn Kakao"><button type="button" onclick="location.href='${googleUrl}';">카카오로 회원가입</button></div>
|
||||
<div class="Btn Google"><button type="button" onclick="location.href='${kakaoUrl}';">Google 계정으로 가입</button></div>
|
||||
<div class="Btn Kakao"><button type="button" onclick="location.href='${kakaoUrl}';">카카오로 회원가입</button></div>
|
||||
<div class="Btn Google"><button type="button" onclick="location.href='${googleUrl}';">Google 계정으로 가입</button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user