authKey 생성관련 함수 추가
This commit is contained in:
parent
eb61153fc1
commit
e2a15b996f
@ -1,6 +1,10 @@
|
|||||||
package nlib.user.service;
|
package nlib.user.service;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Base64;
|
||||||
|
|
||||||
|
import nlib.cmm.NlibCommonController;
|
||||||
|
import nlib.util.StringUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -26,9 +30,6 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public class NlibLoginVO implements Serializable {
|
public class NlibLoginVO implements Serializable {
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = -8274004534207618049L;
|
private static final long serialVersionUID = -8274004534207618049L;
|
||||||
|
|
||||||
private String userId; /* 사용자아이디 (ex: U1000000001) */
|
private String userId; /* 사용자아이디 (ex: U1000000001) */
|
||||||
@ -66,6 +67,31 @@ public class NlibLoginVO implements Serializable {
|
|||||||
|
|
||||||
private String authKey; /* 로그인 인증키 */
|
private String authKey; /* 로그인 인증키 */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 로그인인증키값을 리턴한다. 만일 존재하지 않을 경우, userId를 기반으로 인증키를 생성하여 리턴한다.
|
||||||
|
* 로그인되지 않은 자(userId값이 존재하지 않는경우)에 대해서는 null을 리턴한다.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getAndCreateAuthKey() {
|
||||||
|
return getAndCreateAuthKey(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 로그인인증키값을 리턴한다. 만일 존재하지 않을 경우, userId를 기반으로 인증키를 생성하여 리턴한다.
|
||||||
|
* 로그인되지 않은 자(userId값이 존재하지 않는경우)에 대해서는 세션ID를 기반으로한 손님용 인증키를 생성하여 리턴한다.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getAndCreateAuthKey(String sessionId) {
|
||||||
|
if(StringUtil.isNotEmpty(this.authKey)) return this.authKey;
|
||||||
|
|
||||||
|
// AuthKey 생성하여 리턴
|
||||||
|
this.authKey = NlibCommonController.makeAuthKey(this.userId, sessionId);
|
||||||
|
return this.authKey;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
// SETTER.GETTER
|
// SETTER.GETTER
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
@ -326,6 +352,7 @@ public class NlibLoginVO implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getAuthKey() {
|
public String getAuthKey() {
|
||||||
|
|
||||||
return authKey;
|
return authKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -333,4 +360,5 @@ public class NlibLoginVO implements Serializable {
|
|||||||
this.authKey = authKey;
|
this.authKey = authKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user