소스 검색

fix format

shimingxy 5 년 전
부모
커밋
f3b799e741
88개의 변경된 파일1202개의 추가작업 그리고 1286개의 파일을 삭제
  1. 2 2
      maxkey-authentications/src/main/java/org/maxkey/authn/support/basic/BasicEntryPoint.java
  2. 2 2
      maxkey-authentications/src/main/java/org/maxkey/authn/support/httpheader/HttpHeaderEntryPoint.java
  3. 2 2
      maxkey-authentications/src/main/java/org/maxkey/authn/support/kerberos/RemoteKerberosService.java
  4. 2 2
      maxkey-authentications/src/main/java/org/maxkey/authn/support/socialsignon/SocialSignOnEndpoint.java
  5. 2 2
      maxkey-authentications/src/main/java/org/maxkey/authn/support/wsfederation/WsFederationServiceImpl.java
  6. 3 3
      maxkey-core/src/main/java/org/maxkey/authn/AbstractAuthenticationProvider.java
  7. 10 10
      maxkey-core/src/main/java/org/maxkey/authn/realm/AbstractAuthenticationRealm.java
  8. 167 188
      maxkey-core/src/main/java/org/maxkey/authn/support/jwt/JwtLoginService.java
  9. 2 2
      maxkey-core/src/main/java/org/maxkey/authn/support/rememberme/AbstractRemeberMeService.java
  10. 10 6
      maxkey-core/src/main/java/org/maxkey/authn/support/rememberme/RemeberMe.java
  11. 0 44
      maxkey-core/src/main/java/org/maxkey/constants/BOOLEAN.java
  12. 41 0
      maxkey-core/src/main/java/org/maxkey/constants/Boolean.java
  13. 12 0
      maxkey-core/src/main/java/org/maxkey/constants/ConstantsEntryType.java
  14. 20 0
      maxkey-core/src/main/java/org/maxkey/constants/ConstantsLoginType.java
  15. 19 0
      maxkey-core/src/main/java/org/maxkey/constants/ConstantsOperateAction.java
  16. 14 0
      maxkey-core/src/main/java/org/maxkey/constants/ConstantsOperateMessage.java
  17. 18 0
      maxkey-core/src/main/java/org/maxkey/constants/ConstantsPasswordSetType.java
  18. 10 0
      maxkey-core/src/main/java/org/maxkey/constants/ConstantsPlatformRole.java
  19. 29 0
      maxkey-core/src/main/java/org/maxkey/constants/ConstantsProtocols.java
  20. 120 0
      maxkey-core/src/main/java/org/maxkey/constants/ConstantsServiceMessage.java
  21. 30 0
      maxkey-core/src/main/java/org/maxkey/constants/ConstantsStatus.java
  22. 23 0
      maxkey-core/src/main/java/org/maxkey/constants/ConstantsTimeInterval.java
  23. 0 12
      maxkey-core/src/main/java/org/maxkey/constants/ENTRY_TYPE.java
  24. 0 21
      maxkey-core/src/main/java/org/maxkey/constants/LOGINTYPE.java
  25. 0 19
      maxkey-core/src/main/java/org/maxkey/constants/OPERATEACTION.java
  26. 0 16
      maxkey-core/src/main/java/org/maxkey/constants/OPERATEMESSAGE.java
  27. 0 20
      maxkey-core/src/main/java/org/maxkey/constants/PASSWORDSETTYPE.java
  28. 0 10
      maxkey-core/src/main/java/org/maxkey/constants/PLATFORMROLE.java
  29. 0 38
      maxkey-core/src/main/java/org/maxkey/constants/PROTOCOLS.java
  30. 0 121
      maxkey-core/src/main/java/org/maxkey/constants/SERVICEMESSAGE.java
  31. 0 30
      maxkey-core/src/main/java/org/maxkey/constants/STATUS.java
  32. 4 99
      maxkey-core/src/main/java/org/maxkey/crypto/password/opt/AbstractOptAuthn.java
  33. 0 5
      maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/CapOtpAuthn.java
  34. 0 4
      maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/CounterBasedOtpAuthn.java
  35. 0 5
      maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/HotpOtpAuthn.java
  36. 2 7
      maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/MailOtpAuthn.java
  37. 0 5
      maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/MobileOtpAuthn.java
  38. 0 5
      maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/RsaOtpAuthn.java
  39. 1 7
      maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/SmsOtpAuthn.java
  40. 1 3
      maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/TimeBasedOtpAuthn.java
  41. 2 4
      maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/sms/netease/SmsOtpAuthnYunxin.java
  42. 5 0
      maxkey-core/src/main/java/org/maxkey/crypto/password/opt/token/AbstractOptTokenStore.java
  43. 19 0
      maxkey-core/src/main/java/org/maxkey/crypto/password/opt/token/InMemoryOptTokenStore.java
  44. 110 0
      maxkey-core/src/main/java/org/maxkey/crypto/password/opt/token/JdbcOptTokenStore.java
  45. 5 0
      maxkey-core/src/main/java/org/maxkey/crypto/password/opt/token/RedisOptTokenStore.java
  46. 298 371
      maxkey-core/src/main/java/org/maxkey/domain/PasswordPolicy.java
  47. 2 2
      maxkey-core/src/main/java/org/maxkey/domain/apps/Apps.java
  48. 0 2
      maxkey-dao/src/main/java/org/maxkey/dao/service/MyProfileService.java
  49. 3 3
      maxkey-dao/src/main/java/org/maxkey/dao/service/UserInfoService.java
  50. 10 10
      maxkey-protocols/maxkey-protocol-authorize/src/main/java/org/maxkey/authz/endpoint/AuthorizeEndpoint.java
  51. 2 2
      maxkey-protocols/maxkey-protocol-authorize/src/main/java/org/maxkey/authz/endpoint/adapter/AbstractAuthorizeAdapter.java
  52. 2 2
      maxkey-protocols/maxkey-protocol-cas/src/main/java/org/maxkey/authz/cas/endpoint/Cas20AuthorizeEndpoint.java
  53. 3 3
      maxkey-protocols/maxkey-protocol-cas/src/main/java/org/maxkey/authz/cas/endpoint/Cas30AuthorizeEndpoint.java
  54. 2 2
      maxkey-protocols/maxkey-protocol-desktop/src/main/java/org/maxkey/authz/desktop/endpoint/DesktopAuthorizeEndpoint.java
  55. 2 2
      maxkey-protocols/maxkey-protocol-extendapi/src/main/java/org/maxkey/authz/exapi/endpoint/ExtendApiAuthorizeEndpoint.java
  56. 2 2
      maxkey-protocols/maxkey-protocol-formbased/src/main/java/org/maxkey/authz/formbased/endpoint/FormBasedAuthorizeEndpoint.java
  57. 2 2
      maxkey-protocols/maxkey-protocol-formbased/src/main/java/org/maxkey/authz/formbased/endpoint/adapter/FormBasedDefaultAdapter.java
  58. 2 2
      maxkey-protocols/maxkey-protocol-formbased/src/main/java/org/maxkey/authz/formbased/endpoint/adapter/FormBasedNetease163EmailAdapter.java
  59. 2 2
      maxkey-protocols/maxkey-protocol-formbased/src/main/java/org/maxkey/authz/formbased/endpoint/adapter/FormBasedRedirectAdapter.java
  60. 2 2
      maxkey-protocols/maxkey-protocol-oauth-2.0/src/main/java/org/maxkey/authz/oauth2/provider/userinfo/endpoint/UserInfoEndpoint.java
  61. 2 2
      maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/consumer/endpoint/ConsumerEndpoint.java
  62. 2 2
      maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/provider/xml/AttributeStatementGenerator.java
  63. 2 2
      maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/provider/xml/AuthnResponseGenerator.java
  64. 2 2
      maxkey-protocols/maxkey-protocol-tokenbased/src/main/java/org/maxkey/authz/token/endpoint/TokenBasedAuthorizeEndpoint.java
  65. 8 8
      maxkey-protocols/maxkey-protocol-tokenbased/src/main/java/org/maxkey/authz/token/endpoint/adapter/TokenBasedDefaultAdapter.java
  66. 7 7
      maxkey-protocols/maxkey-protocol-tokenbased/src/main/java/org/maxkey/authz/token/endpoint/adapter/TokenBasedSimpleAdapter.java
  67. 11 11
      maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/ApplicationsController.java
  68. 3 3
      maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/BaseAppContorller.java
  69. 9 9
      maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/BasicDetailsController.java
  70. 9 9
      maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/CasDetailsController.java
  71. 9 9
      maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/DesktopDetailsController.java
  72. 9 9
      maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/ExtendApiDetailsController.java
  73. 9 9
      maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/FormBasedDetailsController.java
  74. 9 9
      maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/OAuth20DetailsController.java
  75. 9 9
      maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/SAML20DetailsController.java
  76. 9 11
      maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/TokenBasedDetailsController.java
  77. 4 4
      maxkey-web-manage/src/main/java/org/maxkey/web/contorller/AccountsController.java
  78. 5 5
      maxkey-web-manage/src/main/java/org/maxkey/web/contorller/GroupMemberController.java
  79. 5 5
      maxkey-web-manage/src/main/java/org/maxkey/web/contorller/GroupPrivilegesController.java
  80. 9 9
      maxkey-web-manage/src/main/java/org/maxkey/web/contorller/GroupsController.java
  81. 9 9
      maxkey-web-manage/src/main/java/org/maxkey/web/contorller/IpAddrFilterController.java
  82. 3 3
      maxkey-web-manage/src/main/java/org/maxkey/web/contorller/PasswordPolicyController.java
  83. 11 11
      maxkey-web-manage/src/main/java/org/maxkey/web/contorller/UserInfoController.java
  84. 8 8
      maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/AppListController.java
  85. 3 3
      maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/ProfileController.java
  86. 2 2
      maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/RegistrationController.java
  87. 8 8
      maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/SafeController.java
  88. 5 5
      maxkey-web-maxkey/src/main/java/org/maxkey/web/endpoint/IndexEndpoint.java

+ 2 - 2
maxkey-authentications/src/main/java/org/maxkey/authn/support/basic/BasicEntryPoint.java

@@ -3,7 +3,7 @@ package org.maxkey.authn.support.basic;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.maxkey.constants.LOGINTYPE;
+import org.maxkey.constants.ConstantsLoginType;
 import org.maxkey.util.AuthorizationHeaderUtils;
 import org.maxkey.web.WebContext;
 import org.slf4j.Logger;
@@ -99,7 +99,7 @@ public class BasicEntryPoint extends HandlerInterceptorAdapter {
 		 }
 		 
 		 if(!isAuthenticated){
-			if(WebContext.setAuthentication(username,LOGINTYPE.BASIC,"","","success")){
+			if(WebContext.setAuthentication(username,ConstantsLoginType.BASIC,"","","success")){
 				_logger.info("Authentication  "+username+" successful .");
 			}
 		 }

+ 2 - 2
maxkey-authentications/src/main/java/org/maxkey/authn/support/httpheader/HttpHeaderEntryPoint.java

@@ -3,7 +3,7 @@ package org.maxkey.authn.support.httpheader;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.maxkey.constants.LOGINTYPE;
+import org.maxkey.constants.ConstantsLoginType;
 import org.maxkey.web.WebContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -86,7 +86,7 @@ public class HttpHeaderEntryPoint extends HandlerInterceptorAdapter {
 		 }
 		 
 		 if(!isAuthenticated){
-			if(WebContext.setAuthentication(httpHeaderUsername,LOGINTYPE.HTTPHEADER,"","","success")){
+			if(WebContext.setAuthentication(httpHeaderUsername,ConstantsLoginType.HTTPHEADER,"","","success")){
 				_logger.info("Authentication  "+httpHeaderUsername+" successful .");
 			}
 		 }

+ 2 - 2
maxkey-authentications/src/main/java/org/maxkey/authn/support/kerberos/RemoteKerberosService.java

@@ -6,7 +6,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.joda.time.DateTime;
-import org.maxkey.constants.LOGINTYPE;
+import org.maxkey.constants.ConstantsLoginType;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.util.DateUtils;
 import org.maxkey.util.JsonUtils;
@@ -37,7 +37,7 @@ public class RemoteKerberosService  implements KerberosService{
 		DateTime notOnOrAfter=DateUtils.toUtcDate(kerberosToken.getNotOnOrAfter());
 		_logger.debug("Kerberos Token is After Now  "+notOnOrAfter.isAfterNow());
 		if(notOnOrAfter.isAfterNow()){
-	    	return WebContext.setAuthentication(kerberosToken.getPrincipal(),LOGINTYPE.KERBEROS,kerberosUserDomain,"","success");
+	    	return WebContext.setAuthentication(kerberosToken.getPrincipal(),ConstantsLoginType.KERBEROS,kerberosUserDomain,"","success");
 		}else{
 			
 			return false;

+ 2 - 2
maxkey-authentications/src/main/java/org/maxkey/authn/support/socialsignon/SocialSignOnEndpoint.java

@@ -7,7 +7,7 @@ import javax.servlet.http.HttpServletRequest;
 
 import org.maxkey.authn.realm.AbstractAuthenticationRealm;
 import org.maxkey.authn.support.socialsignon.service.SocialSignOnUserToken;
-import org.maxkey.constants.LOGINTYPE;
+import org.maxkey.constants.ConstantsLoginType;
 import org.maxkey.web.WebContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -138,7 +138,7 @@ public class SocialSignOnEndpoint  extends AbstractSocialSignOnEndpoint{
 
 			_logger.debug("Social Sign On from "+socialSignOnUserToken.getProvider()+" mapping to user "+socialSignOnUserToken.getUsername());
 			
-			if(WebContext.setAuthentication(socialSignOnUserToken.getUsername(), LOGINTYPE.SOCIALSIGNON,this.socialSignOnProvider.getProviderName(),"xe00000004","success")){
+			if(WebContext.setAuthentication(socialSignOnUserToken.getUsername(), ConstantsLoginType.SOCIALSIGNON,this.socialSignOnProvider.getProviderName(),"xe00000004","success")){
 				//socialSignOnUserToken.setAccessToken(JsonUtils.object2Json(this.accessToken));
 				socialSignOnUserToken.setSocialUserInfo(accountJsonString);
 				//socialSignOnUserToken.setExAttribute(JsonUtils.object2Json(accessToken.getResponseObject()));

+ 2 - 2
maxkey-authentications/src/main/java/org/maxkey/authn/support/wsfederation/WsFederationServiceImpl.java

@@ -2,7 +2,7 @@ package org.maxkey.authn.support.wsfederation;
 
 import javax.servlet.http.HttpServletRequest;
 
-import org.maxkey.constants.LOGINTYPE;
+import org.maxkey.constants.ConstantsLoginType;
 import org.maxkey.util.StringUtils;
 import org.maxkey.web.WebContext;
 import org.opensaml.saml1.core.impl.AssertionImpl;
@@ -42,7 +42,7 @@ public class WsFederationServiceImpl implements   WsFederationService{
 
                     return WebContext.setAuthentication(
                     		wsFederationCredential.getAttributes().get("").toString(),
-                    		LOGINTYPE.WSFEDERATION,
+                    		ConstantsLoginType.WSFEDERATION,
                     		"","","success");
 
                 } else {

+ 3 - 3
maxkey-core/src/main/java/org/maxkey/authn/AbstractAuthenticationProvider.java

@@ -3,7 +3,7 @@ package org.maxkey.authn;
 import org.maxkey.authn.realm.AbstractAuthenticationRealm;
 import org.maxkey.authn.support.rememberme.AbstractRemeberMeService;
 import org.maxkey.config.ApplicationConfig;
-import org.maxkey.constants.LOGINTYPE;
+import org.maxkey.constants.ConstantsLoginType;
 import org.maxkey.crypto.password.PasswordReciprocal;
 import org.maxkey.crypto.password.opt.AbstractOptAuthn;
 import org.maxkey.domain.UserInfo;
@@ -93,7 +93,7 @@ public abstract class AbstractAuthenticationProvider {
         _logger.debug("Login Success Session {}.", WebContext.getSession().getId());
 
         authenticationRealm.insertLoginHistory(
-                userInfo, LOGINTYPE.LOCAL, "", "xe00000004", "success");
+                userInfo, ConstantsLoginType.LOCAL, "", "xe00000004", "success");
 
         // 认证设置
         WebContext.setAuthentication(authentication);
@@ -268,7 +268,7 @@ public abstract class AbstractAuthenticationProvider {
             loginUser.setId(loginUser.generateId());
             loginUser.setDisplayName("not exist");
             loginUser.setLoginCount(0);
-            authenticationRealm.insertLoginHistory(loginUser, LOGINTYPE.LOCAL, "",
+            authenticationRealm.insertLoginHistory(loginUser, ConstantsLoginType.LOCAL, "",
                     WebContext.getI18nValue("login.error.username"), "user not exist");
             throw new BadCredentialsException(WebContext.getI18nValue("login.error.username"));
         }

+ 10 - 10
maxkey-core/src/main/java/org/maxkey/authn/realm/AbstractAuthenticationRealm.java

@@ -11,9 +11,9 @@ import org.joda.time.DateTime;
 import org.joda.time.Duration;
 import org.joda.time.format.DateTimeFormat;
 import org.maxkey.authn.support.rememberme.AbstractRemeberMeService;
-import org.maxkey.constants.LOGINTYPE;
-import org.maxkey.constants.PASSWORDSETTYPE;
-import org.maxkey.constants.STATUS;
+import org.maxkey.constants.ConstantsLoginType;
+import org.maxkey.constants.ConstantsPasswordSetType;
+import org.maxkey.constants.ConstantsStatus;
 import org.maxkey.domain.Groups;
 import org.maxkey.domain.PasswordPolicy;
 import org.maxkey.domain.UserInfo;
@@ -108,13 +108,13 @@ public abstract class AbstractAuthenticationRealm {
                     WebContext.getI18nValue("login.error.attempts") + " " + userInfo.getBadPasswordCount());
         }
 
-        if (userInfo.getPasswordSetType() != PASSWORDSETTYPE.PASSWORD_NORMAL) {
+        if (userInfo.getPasswordSetType() != ConstantsPasswordSetType.PASSWORD_NORMAL) {
             WebContext.getSession().setAttribute(WebConstants.CURRENT_LOGIN_USER_PASSWORD_SET_TYPE,
                     userInfo.getPasswordSetType());
             return true;
         } else {
             WebContext.getSession().setAttribute(WebConstants.CURRENT_LOGIN_USER_PASSWORD_SET_TYPE,
-                    PASSWORDSETTYPE.PASSWORD_NORMAL);
+                    ConstantsPasswordSetType.PASSWORD_NORMAL);
         }
 
         /*
@@ -134,7 +134,7 @@ public abstract class AbstractAuthenticationRealm {
             _logger.debug("validate result " + (intDuration <= getPasswordPolicy().getExpiration()));
             if (intDuration > getPasswordPolicy().getExpiration()) {
                 WebContext.getSession().setAttribute(WebConstants.CURRENT_LOGIN_USER_PASSWORD_SET_TYPE,
-                        PASSWORDSETTYPE.PASSWORD_EXPIRED);
+                        ConstantsPasswordSetType.PASSWORD_EXPIRED);
             }
         }
 
@@ -171,7 +171,7 @@ public abstract class AbstractAuthenticationRealm {
         try {
             if (userInfo != null && StringUtils.isNotEmpty(userInfo.getId())) {
                 jdbcTemplate.update(LOCK_USER_UPDATE_STATEMENT,
-                        new Object[] { STATUS.LOCK, new Date(), userInfo.getId() },
+                        new Object[] { ConstantsStatus.LOCK, new Date(), userInfo.getId() },
                         new int[] { Types.VARCHAR, Types.TIMESTAMP, Types.VARCHAR });
             }
         } catch (Exception e) {
@@ -188,7 +188,7 @@ public abstract class AbstractAuthenticationRealm {
         try {
             if (userInfo != null && StringUtils.isNotEmpty(userInfo.getId())) {
                 jdbcTemplate.update(UNLOCK_USER_UPDATE_STATEMENT,
-                        new Object[] { STATUS.ACTIVE, new Date(), userInfo.getId() },
+                        new Object[] { ConstantsStatus.ACTIVE, new Date(), userInfo.getId() },
                         new int[] { Types.VARCHAR, Types.TIMESTAMP, Types.VARCHAR });
             }
         } catch (Exception e) {
@@ -205,7 +205,7 @@ public abstract class AbstractAuthenticationRealm {
         try {
             if (userInfo != null && StringUtils.isNotEmpty(userInfo.getId())) {
                 jdbcTemplate.update(BADPASSWORDCOUNT_RESET_UPDATE_STATEMENT,
-                        new Object[] { 0, STATUS.ACTIVE, new Date(), userInfo.getId() },
+                        new Object[] { 0, ConstantsStatus.ACTIVE, new Date(), userInfo.getId() },
                         new int[] { Types.INTEGER, Types.INTEGER, Types.TIMESTAMP, Types.VARCHAR });
             }
         } catch (Exception e) {
@@ -227,7 +227,7 @@ public abstract class AbstractAuthenticationRealm {
                 jdbcTemplate.update(BADPASSWORDCOUNT_UPDATE_STATEMENT,
                         new Object[] { badPasswordCount, new Date(), userInfo.getId() },
                         new int[] { Types.INTEGER, Types.TIMESTAMP, Types.VARCHAR });
-                insertLoginHistory(userInfo, LOGINTYPE.LOCAL, "", "xe00000004", "password error");
+                insertLoginHistory(userInfo, ConstantsLoginType.LOCAL, "", "xe00000004", "password error");
             }
         } catch (Exception e) {
             e.printStackTrace();

+ 167 - 188
maxkey-core/src/main/java/org/maxkey/authn/support/jwt/JwtLoginService.java

@@ -1,205 +1,184 @@
 package org.maxkey.authn.support.jwt;
 
+import com.nimbusds.jose.JOSEException;
+import com.nimbusds.jose.JWSAlgorithm;
+import com.nimbusds.jose.JWSHeader;
+import com.nimbusds.jose.crypto.RSASSAVerifier;
+import com.nimbusds.jose.jwk.RSAKey;
+import com.nimbusds.jwt.JWT;
+import com.nimbusds.jwt.JWTClaimsSet;
+import com.nimbusds.jwt.PlainJWT;
+import com.nimbusds.jwt.SignedJWT;
 import java.util.Date;
 import java.util.UUID;
-
 import javax.servlet.http.HttpServletResponse;
-
 import org.joda.time.DateTime;
 import org.maxkey.config.ApplicationConfig;
 import org.maxkey.config.oidc.OIDCProviderMetadataDetails;
-import org.maxkey.constants.LOGINTYPE;
+import org.maxkey.constants.ConstantsLoginType;
 import org.maxkey.crypto.jwt.signer.service.impl.DefaultJwtSigningAndValidationService;
 import org.maxkey.web.WebContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.nimbusds.jose.JOSEException;
-import com.nimbusds.jose.JWSAlgorithm;
-import com.nimbusds.jose.JWSHeader;
-import com.nimbusds.jose.crypto.RSASSAVerifier;
-import com.nimbusds.jose.jwk.RSAKey;
-import com.nimbusds.jwt.JWT;
-import com.nimbusds.jwt.JWTClaimsSet;
-import com.nimbusds.jwt.PlainJWT;
-import com.nimbusds.jwt.SignedJWT;
 
 public class JwtLoginService {
-	private static final Logger _logger = LoggerFactory
-			.getLogger(JwtLoginService.class);
-
-	protected ApplicationConfig applicationConfig;
-
-	OIDCProviderMetadataDetails jwtProviderMetadata;
-
-	DefaultJwtSigningAndValidationService jwtSignerValidationService;
-
-	public boolean login(String jwt, HttpServletResponse response) {
-		_logger.debug("jwt : " + jwt);
-
-		String username = null;
-		SignedJWT signedJWT = null;
-
-		boolean loginResult = false;
-		JWTClaimsSet  jwtClaimsSet = null;
-		try {
-
-			RSASSAVerifier rsaSSAVerifier = new RSASSAVerifier(
-					((RSAKey) jwtSignerValidationService.getAllPublicKeys()
-							.get(jwtSignerValidationService
-									.getDefaultSignerKeyId())).toRSAPublicKey());
-
-			signedJWT = SignedJWT.parse(jwt);
-			if (signedJWT.verify(rsaSSAVerifier)) {
-				loginResult = true;
-			} else {
-				_logger.debug("verify false ");
-				return false;
-			}
-			jwtClaimsSet = signedJWT.getJWTClaimsSet();
-
-			_logger.debug("" + signedJWT.getPayload());
-			_logger.debug("jwtClaimsSet Issuer " + jwtClaimsSet.getIssuer());
-			_logger.debug("Metadata Issuer " + jwtProviderMetadata.getIssuer());
-
-			if (loginResult
-					&& jwtClaimsSet.getIssuer().equals(
-							jwtProviderMetadata.getIssuer())) {
-				loginResult = true;
-				_logger.debug("Issuer equals ");
-			} else {
-				_logger.debug("Issuer not equals ");
-				return false;
-			}
-
-			_logger.debug("username " + jwtClaimsSet.getSubject());
-
-			if (loginResult && jwtClaimsSet.getSubject() != null) {
-				username = jwtClaimsSet.getSubject();
-			} else {
-				return false;
-			}
-
-			DateTime now = new DateTime();
-
-			if (loginResult
-					&& now.isBefore(jwtClaimsSet.getExpirationTime().getTime())) {
-				if (WebContext.setAuthentication(username, LOGINTYPE.JWT, "",
-						"", "success")) {
-					return true;
-				}
-			}
-		} catch (java.text.ParseException e) {
-			// Invalid signed JWT encoding
-			_logger.error("Invalid signed JWT encoding ");
-		} catch (JOSEException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-			_logger.error("JOSEException ");
-		} 
-
-		return false;
-	}
-
-	public String buildLoginJwt() {
-		_logger.debug("buildLoginJwt .");
-		
-		DateTime currentDateTime = DateTime.now();
-		Date expirationTime = currentDateTime.plusMinutes(5).toDate();
-		_logger.debug("expiration Time : " + expirationTime);
-		JWTClaimsSet jwtClaims =  new JWTClaimsSet.Builder()
-				      .subject(WebContext.getSession().getId())
-				      .expirationTime(expirationTime)
-				      .issuer(jwtProviderMetadata.getIssuer())
-				      .issueTime(currentDateTime.toDate())
-				      .jwtID(UUID.randomUUID().toString())
-				      .build();
-		
-		JWT jwtToken = new PlainJWT(jwtClaims);
-
-		_logger.info("jwt Claims : " + jwtClaims.toString());
-
-		JWSAlgorithm signingAlg = jwtSignerValidationService
-				.getDefaultSigningAlgorithm();
-
-		jwtToken = new SignedJWT(new JWSHeader(signingAlg), jwtClaims);
-		// sign it with the server's key
-		jwtSignerValidationService.signJwt((SignedJWT) jwtToken);
-
-		String tokenString = jwtToken.serialize();
-		_logger.debug("jwt Token : " + tokenString);
-		return tokenString;
-	}
-
-	public boolean jwtTokenValidation(String jwt) {
-		SignedJWT signedJWT = null;
-
-		boolean loginResult = false;
-		JWTClaimsSet jwtClaimsSet = null;
-		try {
-
-			RSASSAVerifier rsaSSAVerifier = new RSASSAVerifier(
-					((RSAKey) jwtSignerValidationService.getAllPublicKeys()
-							.get(jwtSignerValidationService
-									.getDefaultSignerKeyId())).toRSAPublicKey());
-
-			signedJWT = SignedJWT.parse(jwt);
-			if (signedJWT.verify(rsaSSAVerifier)) {
-				loginResult = true;
-			} else {
-				_logger.debug("verify false ");
-			}
-			jwtClaimsSet = signedJWT.getJWTClaimsSet();
-
-			_logger.debug("" + signedJWT.getPayload());
-
-			_logger.debug("username " + jwtClaimsSet.getSubject());
-			
-			_logger.debug("jwtClaimsSet Issuer " + jwtClaimsSet.getIssuer());
-			_logger.debug("Metadata Issuer " + jwtProviderMetadata.getIssuer());
-
-			if (loginResult
-					&& jwtClaimsSet.getIssuer().equals(
-							jwtProviderMetadata.getIssuer())) {
-				loginResult = true;
-				_logger.debug("Issuer equals ");
-			} else {
-				_logger.debug("Issuer not equals ");
-				return false;
-			}
-
-			DateTime now = new DateTime();
-
-			if (loginResult
-					&& now.isBefore(jwtClaimsSet.getExpirationTime().getTime())) {
-				_logger.debug("ExpirationTime  Validation " + now.isBefore(jwtClaimsSet.getExpirationTime().getTime()));
-				loginResult = true;
-			}else{
-				return false;
-			}
-		} catch (java.text.ParseException e) {
-			// Invalid signed JWT encoding
-			_logger.debug("Invalid signed JWT encoding ");
-		} catch (JOSEException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-			_logger.debug("JOSEException ");
-		} 
-		return loginResult;
-	}
-
-	public void setApplicationConfig(ApplicationConfig applicationConfig) {
-		this.applicationConfig = applicationConfig;
-	}
-
-	public void setJwtProviderMetadata(
-			OIDCProviderMetadataDetails jwtProviderMetadata) {
-		this.jwtProviderMetadata = jwtProviderMetadata;
-	}
-
-	public void setJwtSignerValidationService(
-			DefaultJwtSigningAndValidationService jwtSignerValidationService) {
-		this.jwtSignerValidationService = jwtSignerValidationService;
-	}
+    private static final Logger _logger = LoggerFactory.getLogger(JwtLoginService.class);
+
+    protected ApplicationConfig applicationConfig;
+
+    OIDCProviderMetadataDetails jwtProviderMetadata;
+
+    DefaultJwtSigningAndValidationService jwtSignerValidationService;
+
+    public boolean login(String jwt, HttpServletResponse response) {
+        _logger.debug("jwt : " + jwt);
+
+        String username = null;
+        SignedJWT signedJWT = null;
+
+        boolean loginResult = false;
+        JWTClaimsSet jwtClaimsSet = null;
+        try {
+
+            RSASSAVerifier rsaSSAVerifier = new RSASSAVerifier(((RSAKey) jwtSignerValidationService.getAllPublicKeys()
+                    .get(jwtSignerValidationService.getDefaultSignerKeyId())).toRSAPublicKey());
+
+            signedJWT = SignedJWT.parse(jwt);
+            if (signedJWT.verify(rsaSSAVerifier)) {
+                loginResult = true;
+            } else {
+                _logger.debug("verify false ");
+                return false;
+            }
+            jwtClaimsSet = signedJWT.getJWTClaimsSet();
+
+            _logger.debug("" + signedJWT.getPayload());
+            _logger.debug("jwtClaimsSet Issuer " + jwtClaimsSet.getIssuer());
+            _logger.debug("Metadata Issuer " + jwtProviderMetadata.getIssuer());
+
+            if (loginResult && jwtClaimsSet.getIssuer().equals(jwtProviderMetadata.getIssuer())) {
+                loginResult = true;
+                _logger.debug("Issuer equals ");
+            } else {
+                _logger.debug("Issuer not equals ");
+                return false;
+            }
+
+            _logger.debug("username " + jwtClaimsSet.getSubject());
+
+            if (loginResult && jwtClaimsSet.getSubject() != null) {
+                username = jwtClaimsSet.getSubject();
+            } else {
+                return false;
+            }
+
+            DateTime now = new DateTime();
+
+            if (loginResult && now.isBefore(jwtClaimsSet.getExpirationTime().getTime())) {
+                if (WebContext.setAuthentication(username, ConstantsLoginType.JWT, "", "", "success")) {
+                    return true;
+                }
+            }
+        } catch (java.text.ParseException e) {
+            // Invalid signed JWT encoding
+            _logger.error("Invalid signed JWT encoding ");
+        } catch (JOSEException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+            _logger.error("JOSEException ");
+        }
+
+        return false;
+    }
+
+    public String buildLoginJwt() {
+        _logger.debug("buildLoginJwt .");
+
+        DateTime currentDateTime = DateTime.now();
+        Date expirationTime = currentDateTime.plusMinutes(5).toDate();
+        _logger.debug("expiration Time : " + expirationTime);
+        JWTClaimsSet jwtClaims = new JWTClaimsSet.Builder().subject(WebContext.getSession().getId())
+                .expirationTime(expirationTime).issuer(jwtProviderMetadata.getIssuer())
+                .issueTime(currentDateTime.toDate()).jwtID(UUID.randomUUID().toString()).build();
+
+        JWT jwtToken = new PlainJWT(jwtClaims);
+
+        _logger.info("jwt Claims : " + jwtClaims.toString());
+
+        JWSAlgorithm signingAlg = jwtSignerValidationService.getDefaultSigningAlgorithm();
+
+        jwtToken = new SignedJWT(new JWSHeader(signingAlg), jwtClaims);
+        // sign it with the server's key
+        jwtSignerValidationService.signJwt((SignedJWT) jwtToken);
+
+        String tokenString = jwtToken.serialize();
+        _logger.debug("jwt Token : " + tokenString);
+        return tokenString;
+    }
+
+    public boolean jwtTokenValidation(String jwt) {
+        SignedJWT signedJWT = null;
+
+        boolean loginResult = false;
+        JWTClaimsSet jwtClaimsSet = null;
+        try {
+
+            RSASSAVerifier rsaSSAVerifier = new RSASSAVerifier(((RSAKey) jwtSignerValidationService.getAllPublicKeys()
+                    .get(jwtSignerValidationService.getDefaultSignerKeyId())).toRSAPublicKey());
+
+            signedJWT = SignedJWT.parse(jwt);
+            if (signedJWT.verify(rsaSSAVerifier)) {
+                loginResult = true;
+            } else {
+                _logger.debug("verify false ");
+            }
+            jwtClaimsSet = signedJWT.getJWTClaimsSet();
+
+            _logger.debug("" + signedJWT.getPayload());
+
+            _logger.debug("username " + jwtClaimsSet.getSubject());
+
+            _logger.debug("jwtClaimsSet Issuer " + jwtClaimsSet.getIssuer());
+            _logger.debug("Metadata Issuer " + jwtProviderMetadata.getIssuer());
+
+            if (loginResult && jwtClaimsSet.getIssuer().equals(jwtProviderMetadata.getIssuer())) {
+                loginResult = true;
+                _logger.debug("Issuer equals ");
+            } else {
+                _logger.debug("Issuer not equals ");
+                return false;
+            }
+
+            DateTime now = new DateTime();
+
+            if (loginResult && now.isBefore(jwtClaimsSet.getExpirationTime().getTime())) {
+                _logger.debug("ExpirationTime  Validation " + now.isBefore(jwtClaimsSet.getExpirationTime().getTime()));
+                loginResult = true;
+            } else {
+                return false;
+            }
+        } catch (java.text.ParseException e) {
+            // Invalid signed JWT encoding
+            _logger.debug("Invalid signed JWT encoding ");
+        } catch (JOSEException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+            _logger.debug("JOSEException ");
+        }
+        return loginResult;
+    }
+
+    public void setApplicationConfig(ApplicationConfig applicationConfig) {
+        this.applicationConfig = applicationConfig;
+    }
+
+    public void setJwtProviderMetadata(OIDCProviderMetadataDetails jwtProviderMetadata) {
+        this.jwtProviderMetadata = jwtProviderMetadata;
+    }
+
+    public void setJwtSignerValidationService(DefaultJwtSigningAndValidationService jwtSignerValidationService) {
+        this.jwtSignerValidationService = jwtSignerValidationService;
+    }
 
 }

+ 2 - 2
maxkey-core/src/main/java/org/maxkey/authn/support/rememberme/AbstractRemeberMeService.java

@@ -7,7 +7,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import org.joda.time.DateTime;
 import org.maxkey.config.ApplicationConfig;
-import org.maxkey.constants.LOGINTYPE;
+import org.maxkey.constants.ConstantsLoginType;
 import org.maxkey.crypto.Base64Utils;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.util.JsonUtils;
@@ -96,7 +96,7 @@ public abstract class AbstractRemeberMeService {
         if (now.isBefore(expiryDate)) {
             if (WebContext.setAuthentication(
                     storeRemeberMe.getUsername(), 
-                    LOGINTYPE.REMEBER_ME, 
+                    ConstantsLoginType.REMEBER_ME, 
                     "", 
                     "", 
                     "success")

+ 10 - 6
maxkey-core/src/main/java/org/maxkey/authn/support/rememberme/RemeberMe.java

@@ -7,10 +7,7 @@ public class RemeberMe implements Serializable {
 
     private static final long serialVersionUID = 8010496585233991785L;
 
-    /**
-     * The number of seconds in one year (= 60 * 60 * 24 * 365).
-     */
-    public static final Integer ONE_YEAR = 60 * 60 * 24 * 365;
+    
 
     public static final Integer ONE_DAY = 60 * 60 * 24; // 1 day
 
@@ -18,8 +15,15 @@ public class RemeberMe implements Serializable {
 
     public static final Integer TWO_WEEK = ONE_DAY * 14; // 2 week
 
-    public static final Integer TWO_MONTH = ONE_DAY * 30; // 1 month
-
+    public static final Integer ONE_MONTH = ONE_DAY * 30; // 1 month
+    
+    public static final Integer TWO_MONTH = ONE_DAY * 60; // 2 month
+    
+    /**
+     * The number of seconds in one year (= 60 * 60 * 24 * 365).
+     */
+    public static final Integer ONE_YEAR = 60 * 60 * 24 * 365;
+    
     String id;
 
     String username;

+ 0 - 44
maxkey-core/src/main/java/org/maxkey/constants/BOOLEAN.java

@@ -1,44 +0,0 @@
-package org.maxkey.constants;
-
-/**
- * Define int for boolean
- * 0  false
- * 1  true
- * 
- * @author Crystal.Sea
- *
- */
-public class BOOLEAN {
-	
-	public final static int FALSE	=	0;
-	
-	public final static int TRUE	=	1;
-	
-	private int value	=	FALSE;
-
-	
-	public BOOLEAN() {
-		
-	}
-
-	public int getValue() {
-		return value;
-	}
-	
-	public boolean isValue() {
-		return TRUE==value;
-	}
-
-	public void setValue(int value) {
-		this.value = value;
-	}
-
-	public static boolean isTrue(int value){
-		return TRUE==value;
-	}
-	
-	public static boolean isFalse(int value){
-		return FALSE==value;
-	}
-	
-}

+ 41 - 0
maxkey-core/src/main/java/org/maxkey/constants/Boolean.java

@@ -0,0 +1,41 @@
+package org.maxkey.constants;
+
+/**
+ * Define int for boolean 0 false 1 true.
+ * 
+ * @author Crystal.Sea
+ *
+ */
+public class Boolean {
+
+    public static final int FALSE = 0;
+
+    public static  final int TRUE = 1;
+
+    private int value = FALSE;
+
+    public Boolean() {
+
+    }
+
+    public int getValue() {
+        return value;
+    }
+
+    public boolean isValue() {
+        return TRUE == value;
+    }
+
+    public void setValue(int value) {
+        this.value = value;
+    }
+
+    public static boolean isTrue(int value) {
+        return TRUE == value;
+    }
+
+    public static boolean isFalse(int value) {
+        return FALSE == value;
+    }
+
+}

+ 12 - 0
maxkey-core/src/main/java/org/maxkey/constants/ConstantsEntryType.java

@@ -0,0 +1,12 @@
+package org.maxkey.constants;
+
+public class ConstantsEntryType {
+
+    public static int USERINFO_TYPE = 1;
+    public static int ORG_TYPE = 2;
+    public static int GROUP_TYPE = 3;
+    public static int PASSWORD_TYPE = 4;
+    public static int RESOURCES_TYPE = 5;
+    public static int PERMISSIONS_TYPE = 6;
+
+}

+ 20 - 0
maxkey-core/src/main/java/org/maxkey/constants/ConstantsLoginType.java

@@ -0,0 +1,20 @@
+package org.maxkey.constants;
+
+public class ConstantsLoginType {
+
+    public static final String LOCAL = "Local Login";
+    public static final String BASIC = "Basic";
+    public static final String SOCIALSIGNON = "Social Sign On";
+    public static final String REMEBER_ME = "RemeberMe";
+    public static final String DESKTOP = "Desktop";
+    public static final String KERBEROS = "Kerberos";
+    public static final String SAMLTRUST = "SAML v2.0 Trust";
+    public static final String MSADTRUST = "MS AD Trust";
+    public static final String CAS = "CAS";
+    public static final String WSFEDERATION = "WsFederation";
+
+    public static final String JWT = "Jwt";
+
+    public static final String HTTPHEADER = "HttpHeader";
+
+}

+ 19 - 0
maxkey-core/src/main/java/org/maxkey/constants/ConstantsOperateAction.java

@@ -0,0 +1,19 @@
+package org.maxkey.constants;
+
+public final class ConstantsOperateAction {
+
+    public static final int CREATE_ACTION = 1;
+
+    public static final int DELETE_ACTION = 2;
+
+    public static final int UPDATE_ACTION = 3;
+
+    public static final int CHANGE_PASSWORD_ACTION = 4;
+
+    public static final int ADD_MEMBER_ACTION = 5;
+
+    public static final int DELETE_MEMBER_ACTION = 6;
+
+    public static final int VIEW_ACTION = 7;
+
+}

+ 14 - 0
maxkey-core/src/main/java/org/maxkey/constants/ConstantsOperateMessage.java

@@ -0,0 +1,14 @@
+package org.maxkey.constants;
+
+public final class ConstantsOperateMessage {
+
+    public static final String INSERT_SUCCESS = "message.action.insert.success";
+    public static final String INSERT_ERROR = "message.action.insert.error";
+
+    public static final String UPDATE_SUCCESS = "message.action.update.success";
+    public static final String UPDATE_ERROR = "message.action.update.error";
+
+    public static final String DELETE_SUCCESS = "message.action.delete.success";
+    public static final String DELETE_ERROR = "message.action.delete.error";
+
+}

+ 18 - 0
maxkey-core/src/main/java/org/maxkey/constants/ConstantsPasswordSetType.java

@@ -0,0 +1,18 @@
+package org.maxkey.constants;
+
+/**
+ * PASSWORDSETTYPE.
+ * @author Crystal.Sea
+ *
+ */
+public final class ConstantsPasswordSetType {
+
+    public static final int PASSWORD_NORMAL = 0;
+
+    public static final int INITIAL_PASSWORD = 1;
+
+    public static final int MANAGER_CHANGED_PASSWORD = 2;
+
+    public static final int PASSWORD_EXPIRED = 3;
+
+}

+ 10 - 0
maxkey-core/src/main/java/org/maxkey/constants/ConstantsPlatformRole.java

@@ -0,0 +1,10 @@
+package org.maxkey.constants;
+
+public final class ConstantsPlatformRole {
+
+    public static final String PLATFORM_ADMIN = "PLATFORM_ADMIN";
+
+    public static final String TANANT_ADMIN = "TANANT_ADMIN";
+
+    public static final String ORDINARY_USER = "ORDINARY_USER";
+}

+ 29 - 0
maxkey-core/src/main/java/org/maxkey/constants/ConstantsProtocols.java

@@ -0,0 +1,29 @@
+package org.maxkey.constants;
+
+/**
+ * PROTOCOLS.
+ * @author Crystal.Sea
+ *
+ */
+public final class ConstantsProtocols {
+
+    public static final String DESKTOP = "Desktop";
+
+    public static final String BASIC = "Basic";
+
+    public static final String EXTEND_API = "Extend_API";
+
+    public static final String FORMBASED = "Form_Based";
+
+    public static final String TOKENBASED = "Token_Based";
+
+    // OAuth
+    public static final String OAUTH20 = "OAuth_v2.0";
+    // SAML
+    public static final String SAML20 = "SAML_v2.0";
+
+    public static final String OPEN_ID_CONNECT = "OpenID_Connect";
+
+    public static final String CAS = "CAS";
+
+}

+ 120 - 0
maxkey-core/src/main/java/org/maxkey/constants/ConstantsServiceMessage.java

@@ -0,0 +1,120 @@
+package org.maxkey.constants;
+
+public final class ConstantsServiceMessage {
+
+    public static final class EMPLOYEES {
+        public static final String SERVICE_NAME = "employees";
+        public static final String XE00000001 = "XE00000001";
+        public static final String XE00000002 = "XE00000002";
+        public static final String XE00000003 = "XE00000003";
+        public static final String XE00000004 = "XE00000004";
+        public static final String XE00000005 = "XE00000005";
+        public static final String XE00000006 = "XE00000006";
+        public static final String XE00000007 = "XE00000007";
+        public static final String XE00000008 = "XE00000008";
+
+        public static final String XW00000001 = "XW00000001";
+        public static final String XW00000002 = "XW00000002";
+
+        public static final String XS00000001 = "XS00000001";
+        public static final String XS00000002 = "XS00000002";
+        public static final String XS00000003 = "XS00000003";
+
+    }
+
+    public static final class ENTERPRISES {
+        public static final String SERVICE_NAME = "enterprises";
+        public static final String XE00000001 = "XE00000001";
+        public static final String XE00000002 = "XE00000002";
+        public static final String XE00000003 = "XE00000003";
+        public static final String XE00000004 = "XE00000004";
+        public static final String XE00000005 = "XE00000005";
+        public static final String XE00000006 = "XE00000006";
+        public static final String XE00000007 = "XE00000007";
+        public static final String XE00000008 = "XE00000008";
+
+        public static final String XS00000001 = "XS00000001";
+        public static final String XS00000002 = "XS00000002";
+        public static final String XS00000003 = "XS00000003";
+        public static final String XS00000004 = "XS00000004";
+    }
+
+    public static final class RETRIEVEPASSWORD {
+        public static final String SERVICE_NAME = "retrievepassword";
+        public static final String XS00000001 = "XS00000001";
+        public static final String XS00000002 = "XS00000002";
+        public static final String XE00000001 = "XE00000001";
+        public static final String XE00000002 = "XE00000002";
+        public static final String XE00000003 = "XE00000003";
+
+    }
+
+    public static final class USERCENTER {
+        public static final String SERVICE_NAME = "usercenter";
+        public static final String XS00000001 = "XS00000001";
+        public static final String XS00000002 = "XS00000002";
+        public static final String XS00000003 = "XS00000003";
+        public static final String XE00000001 = "XE00000001";
+        public static final String XE00000002 = "XE00000002";
+        public static final String XE00000003 = "XE00000003";
+
+    }
+
+    public static final class APPLICATIONS {
+        public static final String SERVICE_NAME = "applications";
+        public static final String XS00000001 = "XS00000001";
+        public static final String XS00000002 = "XS00000002";
+        public static final String XS00000003 = "XS00000003";
+        public static final String XS00000004 = "XS00000004";
+
+        public static final String XE00000001 = "XE00000001";
+        public static final String XE00000002 = "XE00000002";
+        public static final String XE00000003 = "XE00000003";
+        public static final String XE00000004 = "XE00000004";
+
+    }
+
+    public static final class APPROLES {
+        public static final String SERVICE_NAME = "approles";
+        public static final String XE00000002 = "XE00000002";
+        public static final String XS00000002 = "XS00000002";
+        public static final String XE00000001 = "XE00000001";
+        public static final String XS00000001 = "XS00000001";
+        public static final String XE00000003 = "XE00000003";
+        public static final String XS00000003 = "XS00000003";
+        public static final String XE00000004 = "XE00000004";
+        public static final String XS00000004 = "XS00000004";
+        public static final String XS00000005 = "XS00000005";
+        public static final String XE00000005 = "XE00000005";
+        public static final String XE00000006 = "XE00000006";
+        public static final String XS00000006 = "XS00000006";
+        public static final String XE00000007 = "XE00000007";
+        public static final String XS00000007 = "XS00000007";
+        public static final String XS00000008 = "XS00000008";
+        public static final String XE00000008 = "XE00000008";
+        public static final String XE00000009 = "XE00000009";
+        public static final String XS00000009 = "XS00000009";
+    }
+
+    public static final class APIUSERS {
+        public static final String SERVICE_NAME = "apiusers";
+        public static final String XS00000003 = "XS00000003";
+        public static final String XE00000003 = "XE00000003";
+        public static final String XW00000001 = "XW00000001";
+        public static final String XW00000002 = "XW00000002";
+        public static final String XS00000001 = "XS00000001";
+        public static final String XE00000001 = "XE00000001";
+    }
+
+    public static final class PASSWORDPOLICY {
+        public static final String SERVICE_NAME = "passwordpolicy";
+        public static final String XW00000002 = "XW00000002";
+        public static final String XW00000001 = "XW00000001";
+        public static final String XW00000003 = "XW00000003";
+        public static final String XW00000004 = "XW00000004";
+        public static final String XW00000005 = "XW00000005";
+        public static final String XW00000006 = "XW00000006";
+        public static final String XW00000007 = "XW00000007";
+        public static final String XW00000008 = "XW00000008";
+    }
+}

+ 30 - 0
maxkey-core/src/main/java/org/maxkey/constants/ConstantsStatus.java

@@ -0,0 +1,30 @@
+package org.maxkey.constants;
+
+public final class ConstantsStatus {
+    public static final int ACTIVE = 1;
+
+    public static final int INACTIVE = 2;
+
+    public static final int ENABLED = 3;
+
+    public static final int DISABLED = 4;
+
+    public static final int LOCK = 5;
+
+    public static final int UNLOCK = 6;
+
+    public static final int INVALID = 7;
+
+    public static final int EXPIRED = 8;
+
+    public static final int DELETE = 9;
+
+    public static final int VALIDATED = 10;
+
+    public static final int START = 11;
+
+    public static final int STOP = 12;
+
+    public static final int APPROVED = 13;
+
+}

+ 23 - 0
maxkey-core/src/main/java/org/maxkey/constants/ConstantsTimeInterval.java

@@ -0,0 +1,23 @@
+package org.maxkey.constants;
+
+public final class ConstantsTimeInterval {
+    
+    public static final Integer ONE_MINUTE = 60; // 1 minutes 
+    
+    public static final Integer ONE_HOUR = 60 * 60; // 1 hour
+    
+    public static final Integer ONE_DAY = 60 * 60 * 24; // 1 day
+
+    public static final Integer ONE_WEEK = ONE_DAY * 7; // 1 week
+
+    public static final Integer TWO_WEEK = ONE_DAY * 14; // 2 week
+
+    public static final Integer ONE_MONTH = ONE_DAY * 30; // 1 month
+    
+    public static final Integer TWO_MONTH = ONE_DAY * 60; // 2 month
+    
+    /**
+     * The number of seconds in one year (= 60 * 60 * 24 * 365).
+     */
+    public static final Integer ONE_YEAR = 60 * 60 * 24 * 365;
+}

+ 0 - 12
maxkey-core/src/main/java/org/maxkey/constants/ENTRY_TYPE.java

@@ -1,12 +0,0 @@
-package org.maxkey.constants;
-
-public  class ENTRY_TYPE{
-	
-	public static int USERINFO_TYPE		=	1;
-	public static int ORG_TYPE			=	2;
-	public static int GROUP_TYPE		=	3;
-	public static int PASSWORD_TYPE		=	4;
-	public static int RESOURCES_TYPE	=	5;
-	public static int PERMISSIONS_TYPE	=	6;
-	
-}

+ 0 - 21
maxkey-core/src/main/java/org/maxkey/constants/LOGINTYPE.java

@@ -1,21 +0,0 @@
-package org.maxkey.constants;
-
-public class LOGINTYPE {
-
-	public static final String LOCAL 			= 		"Local Login";
-	public static final String BASIC 			= 		"Basic";
-	public static final String SOCIALSIGNON 	= 		"Social Sign On";
-	public static final String REMEBER_ME		=		"RemeberMe";
-	public static final String DESKTOP 			= 		"Desktop";
-	public static final String KERBEROS 		= 		"Kerberos";
-	public static final String SAMLTRUST 		= 		"SAML v2.0 Trust";
-	public static final String MSADTRUST 		= 		"MS AD Trust";
-	public static final String CAS 				= 		"CAS";
-	public static final String WSFEDERATION 	= 		"WsFederation";
-	
-	public static final String JWT 				= 		"Jwt";
-	
-	public static final String HTTPHEADER 		= 		"HttpHeader";
-	
-	
-}

+ 0 - 19
maxkey-core/src/main/java/org/maxkey/constants/OPERATEACTION.java

@@ -1,19 +0,0 @@
-package org.maxkey.constants;
-
-public final class OPERATEACTION {
-
-	public static final int CREATE_ACTION 			= 	1;
-	
-	public static final int DELETE_ACTION 			= 	2;
-	
-	public static final int UPDATE_ACTION 			= 	3;
-	
-	public static final int CHANGE_PASSWORD_ACTION 	= 	4;
-	
-	public static final int ADD_MEMBER_ACTION 		= 	5;
-	
-	public static final int DELETE_MEMBER_ACTION 	= 	6;
-	
-	public static final int VIEW_ACTION 			= 	7;
-
-}

+ 0 - 16
maxkey-core/src/main/java/org/maxkey/constants/OPERATEMESSAGE.java

@@ -1,16 +0,0 @@
-package org.maxkey.constants;
-
-public final class OPERATEMESSAGE {
-
-	public static final String INSERT_SUCCESS="message.action.insert.success";
-	public static final String INSERT_ERROR="message.action.insert.error";
-	
-	public static final String UPDATE_SUCCESS="message.action.update.success";
-	public static final String UPDATE_ERROR="message.action.update.error";
-	
-	public static final String DELETE_SUCCESS="message.action.delete.success";
-	public static final String DELETE_ERROR="message.action.delete.error";
-
-
-	
-}

+ 0 - 20
maxkey-core/src/main/java/org/maxkey/constants/PASSWORDSETTYPE.java

@@ -1,20 +0,0 @@
-/**
- * 
- */
-package org.maxkey.constants;
-
-/**
- * @author Crystal.Sea
- *
- */
-public  final class PASSWORDSETTYPE {
-
-	public static final int PASSWORD_NORMAL 			= 	0;
-	
-	public static final int INITIAL_PASSWORD 			= 	1;
-	
-	public static final int MANAGER_CHANGED_PASSWORD 	= 	2;
-	
-	public static final int PASSWORD_EXPIRED 			= 	3;
-
-}

+ 0 - 10
maxkey-core/src/main/java/org/maxkey/constants/PLATFORMROLE.java

@@ -1,10 +0,0 @@
-package org.maxkey.constants;
-
-public final class PLATFORMROLE {
-
-	public static final String PLATFORM_ADMIN 	= "PLATFORM_ADMIN";
-	
-	public static final String TANANT_ADMIN 	= "TANANT_ADMIN";
-	
-	public static final String ORDINARY_USER 	= "ORDINARY_USER";
-}

+ 0 - 38
maxkey-core/src/main/java/org/maxkey/constants/PROTOCOLS.java

@@ -1,38 +0,0 @@
-/**
- * 
- */
-package org.maxkey.constants;
-
-/**
- * @author Crystal.Sea
- *
- */
-public  final class PROTOCOLS {
-
-	public static final String DESKTOP 			= 	"Desktop";
-	
-	public static final String BASIC 			= 	"Basic";
-	
-	public static final String EXTEND_API		= 	"Extend_API";
-	
-	public static final String FORMBASED 		= 	"Form_Based";
-	
-	
-	public static final String TOKENBASED 		= 	"Token_Based";
-	
-	//OAuth
-	public static final String OAUTH20  		= 	"OAuth_v2.0";
-	//SAML
-	public static final String SAML20 			= 	"SAML_v2.0";
-	
-	public static final String OPEN_ID_CONNECT 	= 	"OpenID_Connect";
-	
-	public static final String CAS 				= 	"CAS";
-	/**
-	 * 
-	 */
-	public PROTOCOLS() {
-		
-	}
-
-}

+ 0 - 121
maxkey-core/src/main/java/org/maxkey/constants/SERVICEMESSAGE.java

@@ -1,121 +0,0 @@
-package org.maxkey.constants;
-
-public final class SERVICEMESSAGE {
-
-	public static final class EMPLOYEES {
-		public static final String SERVICE_NAME = "employees";
-		public static final String XE00000001 = "XE00000001";
-		public static final String XE00000002 = "XE00000002";
-		public static final String XE00000003 = "XE00000003";
-		public static final String XE00000004 = "XE00000004";
-		public static final String XE00000005 = "XE00000005";
-		public static final String XE00000006 = "XE00000006";
-		public static final String XE00000007 = "XE00000007";
-		public static final String XE00000008 = "XE00000008";
-
-		public static final String XW00000001 = "XW00000001";
-		public static final String XW00000002 = "XW00000002";
-
-		public static final String XS00000001 = "XS00000001";
-		public static final String XS00000002 = "XS00000002";
-		public static final String XS00000003 = "XS00000003";
-
-	}
-
-	public static final class ENTERPRISES{
-		public static final String SERVICE_NAME = "enterprises";
-		public static final String XE00000001 = "XE00000001";
-		public static final String XE00000002 = "XE00000002";
-		public static final String XE00000003 = "XE00000003";
-		public static final String XE00000004 = "XE00000004";
-		public static final String XE00000005 = "XE00000005";
-		public static final String XE00000006 = "XE00000006";
-		public static final String XE00000007 = "XE00000007";
-		public static final String XE00000008 = "XE00000008";
-		
-		public static final String XS00000001 = "XS00000001";
-		public static final String XS00000002 = "XS00000002";
-		public static final String XS00000003 = "XS00000003";
-		public static final String XS00000004 = "XS00000004";
-	}
-
-	public static final class RETRIEVEPASSWORD{
-		public static final String SERVICE_NAME = "retrievepassword";
-		public static final String XS00000001 = "XS00000001";
-		public static final String XS00000002 = "XS00000002";
-		public static final String XE00000001 = "XE00000001";
-		public static final String XE00000002 = "XE00000002";
-		public static final String XE00000003 = "XE00000003";
-		
-	}
-
-	public static final class USERCENTER {
-		public static final String SERVICE_NAME = "usercenter";
-		public static final String XS00000001 = "XS00000001";
-		public static final String XS00000002 = "XS00000002";
-		public static final String XS00000003 = "XS00000003";
-		public static final String XE00000001 = "XE00000001";
-		public static final String XE00000002 = "XE00000002";
-		public static final String XE00000003 = "XE00000003";
-		
-	}
-
-	public static final class APPLICATIONS {
-		public static final String SERVICE_NAME="applications";
-		public static final String XS00000001 = "XS00000001";
-		public static final String XS00000002 = "XS00000002";
-		public static final String XS00000003 = "XS00000003";
-		public static final String XS00000004 = "XS00000004";
-		
-		public static final String XE00000001 = "XE00000001";
-		public static final String XE00000002 = "XE00000002";
-		public static final String XE00000003 = "XE00000003";
-		public static final String XE00000004 = "XE00000004";
-		
-		
-	}
-
-	public static final class APPROLES{
-		public static final String SERVICE_NAME="approles";
-		public static final String XE00000002 = "XE00000002";
-		public static final String XS00000002 = "XS00000002";
-		public static final String XE00000001 = "XE00000001";
-		public static final String XS00000001 = "XS00000001";
-		public static final String XE00000003 = "XE00000003";
-		public static final String XS00000003 = "XS00000003";
-		public static final String XE00000004 = "XE00000004";
-		public static final String XS00000004 = "XS00000004";
-		public static final String XS00000005 = "XS00000005";
-		public static final String XE00000005 = "XE00000005";
-		public static final String XE00000006 = "XE00000006";
-		public static final String XS00000006 = "XS00000006";
-		public static final String XE00000007 = "XE00000007";
-		public static final String XS00000007 = "XS00000007";
-		public static final String XS00000008 = "XS00000008";
-		public static final String XE00000008 = "XE00000008";
-		public static final String XE00000009 = "XE00000009";
-		public static final String XS00000009 = "XS00000009";
-	}
-
-	public static final class APIUSERS{
-		public static final String SERVICE_NAME="apiusers";
-		public static final String XS00000003 = "XS00000003";
-		public static final String XE00000003 = "XE00000003";
-		public static final String XW00000001 = "XW00000001";
-		public static final String XW00000002 = "XW00000002";
-		public static final String XS00000001 = "XS00000001";
-		public static final String XE00000001 = "XE00000001";
-	}
-
-	public static final class PASSWORDPOLICY{
-		public static final String SERVICE_NAME="passwordpolicy";
-		public static final String XW00000002 = "XW00000002";
-		public static final String XW00000001 = "XW00000001";
-		public static final String XW00000003 = "XW00000003";
-		public static final String XW00000004 = "XW00000004";
-		public static final String XW00000005 = "XW00000005";
-		public static final String XW00000006 = "XW00000006";
-		public static final String XW00000007 = "XW00000007";
-		public static final String XW00000008 = "XW00000008";
-	}
-}

+ 0 - 30
maxkey-core/src/main/java/org/maxkey/constants/STATUS.java

@@ -1,30 +0,0 @@
-package org.maxkey.constants;
-
-public final class STATUS {
-	public static final int ACTIVE			=	1;
-	
-	public static final int INACTIVE		=	2;
-
-	public static final int ENABLED 		= 	3;
-	
-	public static final int DISABLED 		= 	4;
-	
-	public static final int LOCK 			=	5;
-	
-	public static final int UNLOCK 			=	6;
-
-	public static final int INVALID			=	7;
-	
-	public static final int EXPIRED			=	8;
-	
-	public static final int DELETE 			= 	9;
-	
-	public static final int VALIDATED		=	10;
-	
-	public static final int START			=	11;
-	
-	public static final int STOP 			= 	12;
-	
-	public static final int APPROVED		=	13;
-	
-}

+ 4 - 99
maxkey-core/src/main/java/org/maxkey/crypto/password/opt/AbstractOptAuthn.java

@@ -1,19 +1,9 @@
 package org.maxkey.crypto.password.opt;
 
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Types;
-import java.util.Date;
-import org.joda.time.DateTime;
-import org.joda.time.Duration;
-import org.joda.time.format.DateTimeFormat;
-import org.maxkey.constants.STATUS;
 import org.maxkey.domain.UserInfo;
 import org.maxkey.util.StringGenerator;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.core.RowMapper;
 
 /**
  * AbstractOTPAuthn.
@@ -31,8 +21,6 @@ public abstract class AbstractOptAuthn {
 
     StringGenerator stringGenerator;
 
-    private final JdbcTemplate jdbcTemplate;
-
     public static final class OptTypes {
         // 手机
         public static int MOBILE = 2;
@@ -51,19 +39,6 @@ public abstract class AbstractOptAuthn {
 
     }
 
-    private static final String DEFAULT_DEFAULT_INSERT_STATEMENT = 
-            "INSERT INTO ONE_TIME_PASSWORD(ID ,OPTTYPE,USERNAME,TOKEN,RECEIVER,CREATETIME,STATUS)" 
-                    + " VALUES(?,?,?,?,?,?," + STATUS.ACTIVE + ")";
-
-    private static final String DEFAULT_DEFAULT_SELECT_STATEMENT = 
-            "SELECT ID ,OPTTYPE,USERNAME,TOKEN,RECEIVER,CREATETIME FROM ONE_TIME_PASSWORD"
-            +   " WHERE STATUS =" + STATUS.ACTIVE 
-            +   " AND  USERNAME = ? AND TOKEN = ? AND OPTTYPE = ?";
-
-    private static final String DEFAULT_DEFAULT_DELETE_STATEMENT = 
-            "UPDATE ONE_TIME_PASSWORD SET  STATUS ="
-            + STATUS.DELETE + " WHERE USERNAME = ? AND TOKEN = ? AND OPTTYPE = ?";
-
     public abstract boolean produce(UserInfo userInfo);
 
     public abstract boolean validate(UserInfo userInfo, String token);
@@ -81,62 +56,9 @@ public abstract class AbstractOptAuthn {
         if (stringGenerator == null) {
             stringGenerator = new StringGenerator(StringGenerator.DEFAULT_CODE_NUMBER, digits);
         }
-        return stringGenerator.randomGenerate();
-    }
-
-    public AbstractOptAuthn(JdbcTemplate jdbcTemplate) {
-        this.jdbcTemplate = jdbcTemplate;
-    }
-
-    protected void insertDataBase(UserInfo userInfo, String token, String receiver, int type) {
-        jdbcTemplate.update(DEFAULT_DEFAULT_INSERT_STATEMENT,
-                new Object[] { 
-                        java.util.UUID.randomUUID(), 
-                        type, 
-                        userInfo.getUsername(),
-                        token, 
-                        receiver, 
-                        new Date() 
-                },
-                new int[] { Types.VARCHAR, Types.INTEGER, 
-                        Types.VARCHAR, Types.VARCHAR, 
-                        Types.VARCHAR,Types.TIMESTAMP 
-                }
-        );
-    }
-
-    /**
-     * validateDataBase.
-     * @param userInfo UserInfo
-     * @param token String
-     * @param type int
-     * @return
-     */
-    public boolean validateDataBase(UserInfo userInfo, String token, int type) {
-        OneTimePassword oneTimePassword = jdbcTemplate.queryForObject(
-                DEFAULT_DEFAULT_SELECT_STATEMENT,
-                new OneTimePasswordRowMapper(), userInfo.getUsername(), token, type);
-
-        if (oneTimePassword != null) {
-
-            jdbcTemplate.update(
-                    DEFAULT_DEFAULT_DELETE_STATEMENT, 
-                    new Object[] { userInfo.getUsername(), token, type },
-                    new int[] { Types.VARCHAR, Types.VARCHAR, Types.INTEGER }
-            );
-            DateTime currentdateTime = new DateTime();
-            DateTime oneTimePwdData = DateTime.parse(oneTimePassword.getCreateTime(),
-                    DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss"));
-            Duration duration = new Duration(oneTimePwdData, currentdateTime);
-            int intDuration = Integer.parseInt(duration.getStandardSeconds() + "");
-            logger.debug("validate duration " + intDuration);
-            logger.debug("validate result " + (intDuration <= interval));
-            if (intDuration <= interval) {
-                return true;
-            }
-        }
-        return false;
-
+        String token = stringGenerator.randomGenerate();
+        logger.debug("Generator token " + token);
+        return token;
     }
 
     /**
@@ -187,22 +109,5 @@ public abstract class AbstractOptAuthn {
         this.crypto = crypto;
     }
 
-    public class OneTimePasswordRowMapper implements RowMapper<OneTimePassword> {
-
-        /**
-         *ResultSet.
-         */
-        public OneTimePassword mapRow(ResultSet rs, int rowNum) throws SQLException {
-            OneTimePassword oneTimePassword = new OneTimePassword();
-            oneTimePassword.setId(rs.getString("ID"));
-            oneTimePassword.setType(rs.getInt("OPTTYPE"));
-            oneTimePassword.setUsername(rs.getString("USERNAME"));
-            oneTimePassword.setToken(rs.getString("TOKEN"));
-            oneTimePassword.setUsername(rs.getString("USERNAME"));
-            oneTimePassword.setReceiver(rs.getString("RECEIVER"));
-            oneTimePassword.setCreateTime(rs.getString("CREATETIME"));
-            return oneTimePassword;
-        }
-    }
-
+ 
 }

+ 0 - 5
maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/CapOtpAuthn.java

@@ -2,7 +2,6 @@ package org.maxkey.crypto.password.opt.impl;
 
 import org.maxkey.crypto.password.opt.AbstractOptAuthn;
 import org.maxkey.domain.UserInfo;
-import org.springframework.jdbc.core.JdbcTemplate;
 
 /**
  * Chip Authentication Program EMV stands for Europay, MasterCard and Visa, a
@@ -16,10 +15,6 @@ import org.springframework.jdbc.core.JdbcTemplate;
  */
 public class CapOtpAuthn extends AbstractOptAuthn {
 
-    public CapOtpAuthn(JdbcTemplate jdbcTemplate) {
-        super(jdbcTemplate);
-    }
-
     @Override
     public boolean produce(UserInfo userInfo) {
         // TODO Auto-generated method stub

+ 0 - 4
maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/CounterBasedOtpAuthn.java

@@ -7,14 +7,10 @@ import org.maxkey.crypto.password.opt.algorithm.TimeBasedOTP;
 import org.maxkey.domain.UserInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.jdbc.core.JdbcTemplate;
 
 public class CounterBasedOtpAuthn extends AbstractOptAuthn {
     private static final Logger _logger = LoggerFactory.getLogger(CounterBasedOtpAuthn.class);
 
-    public CounterBasedOtpAuthn(JdbcTemplate jdbcTemplate) {
-        super(jdbcTemplate);
-    }
 
     @Override
     public boolean produce(UserInfo userInfo) {

+ 0 - 5
maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/HotpOtpAuthn.java

@@ -8,7 +8,6 @@ import org.maxkey.crypto.password.opt.algorithm.HOTP;
 import org.maxkey.domain.UserInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.jdbc.core.JdbcTemplate;
 
 public class HotpOtpAuthn extends AbstractOptAuthn {
     private static final  Logger _logger = LoggerFactory.getLogger(HotpOtpAuthn.class);
@@ -16,10 +15,6 @@ public class HotpOtpAuthn extends AbstractOptAuthn {
     boolean addChecksum;
     int truncation = -1;
 
-    public HotpOtpAuthn(JdbcTemplate jdbcTemplate) {
-        super(jdbcTemplate);
-    }
-
     @Override
     public boolean produce(UserInfo userInfo) {
         return true;

+ 2 - 7
maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/MailOtpAuthn.java

@@ -8,16 +8,11 @@ import org.maxkey.crypto.password.opt.AbstractOptAuthn;
 import org.maxkey.domain.UserInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.jdbc.core.JdbcTemplate;
 
 public class MailOtpAuthn extends AbstractOptAuthn {
     private static final Logger _logger = LoggerFactory.getLogger(MailOtpAuthn.class);
     EmailConfig emailConfig;
 
-    public MailOtpAuthn(JdbcTemplate jdbcTemplate) {
-        super(jdbcTemplate);
-    }
-
     @Override
     public boolean produce(UserInfo userInfo) {
         try {
@@ -37,7 +32,7 @@ public class MailOtpAuthn extends AbstractOptAuthn {
             _logger.debug(
                     "token " + token + " send to user +" + userInfo.getUsername() 
                     + ", email " + userInfo.getEmail());
-            this.insertDataBase(userInfo, token, userInfo.getUsername(), OptTypes.EMAIL);
+            //this.insertDataBase(userInfo, token, userInfo.getUsername(), OptTypes.EMAIL);
             return true;
         } catch (Exception e) {
             e.printStackTrace();
@@ -47,7 +42,7 @@ public class MailOtpAuthn extends AbstractOptAuthn {
 
     @Override
     public boolean validate(UserInfo userInfo, String token) {
-        return this.validateDataBase(userInfo, token, OptTypes.EMAIL);
+        return true;
     }
 
     public void setEmailConfig(EmailConfig emailConfig) {

+ 0 - 5
maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/MobileOtpAuthn.java

@@ -2,14 +2,9 @@ package org.maxkey.crypto.password.opt.impl;
 
 import org.maxkey.crypto.password.opt.AbstractOptAuthn;
 import org.maxkey.domain.UserInfo;
-import org.springframework.jdbc.core.JdbcTemplate;
 
 public class MobileOtpAuthn extends AbstractOptAuthn {
 
-    public MobileOtpAuthn(JdbcTemplate jdbcTemplate) {
-        super(jdbcTemplate);
-    }
-
     @Override
     public boolean produce(UserInfo userInfo) {
         // TODO Auto-generated method stub

+ 0 - 5
maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/RsaOtpAuthn.java

@@ -2,7 +2,6 @@ package org.maxkey.crypto.password.opt.impl;
 
 import org.maxkey.crypto.password.opt.AbstractOptAuthn;
 import org.maxkey.domain.UserInfo;
-import org.springframework.jdbc.core.JdbcTemplate;
 
 /**
  * Chip Authentication Program EMV stands for Europay, MasterCard and Visa, a
@@ -16,10 +15,6 @@ import org.springframework.jdbc.core.JdbcTemplate;
  */
 public class RsaOtpAuthn extends AbstractOptAuthn {
 
-    public RsaOtpAuthn(JdbcTemplate jdbcTemplate) {
-        super(jdbcTemplate);
-    }
-
     @Override
     public boolean produce(UserInfo userInfo) {
         // TODO Auto-generated method stub

+ 1 - 7
maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/SmsOtpAuthn.java

@@ -2,26 +2,20 @@ package org.maxkey.crypto.password.opt.impl;
 
 import org.maxkey.crypto.password.opt.AbstractOptAuthn;
 import org.maxkey.domain.UserInfo;
-import org.springframework.jdbc.core.JdbcTemplate;
 
 public class SmsOtpAuthn extends AbstractOptAuthn {
 
-    public SmsOtpAuthn(JdbcTemplate jdbcTemplate) {
-        super(jdbcTemplate);
-    }
-
     @Override
     public boolean produce(UserInfo userInfo) {
         String token = this.genToken(userInfo);
         // TODO:You must add send sms code here
 
-        this.insertDataBase(userInfo, token, userInfo.getUsername(), OptTypes.SMS);
         return true;
     }
 
     @Override
     public boolean validate(UserInfo userInfo, String token) {
-        return this.validateDataBase(userInfo, token, OptTypes.SMS);
+        return true;
     }
 
 }

+ 1 - 3
maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/TimeBasedOtpAuthn.java

@@ -11,14 +11,12 @@ import org.maxkey.crypto.password.opt.algorithm.TimeBasedOTP;
 import org.maxkey.domain.UserInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.jdbc.core.JdbcTemplate;
 
 public class TimeBasedOtpAuthn extends AbstractOptAuthn {
     private static final  Logger _logger = LoggerFactory.getLogger(TimeBasedOtpAuthn.class);
     DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
-    public TimeBasedOtpAuthn(JdbcTemplate jdbcTemplate) {
-        super(jdbcTemplate);
+    public TimeBasedOtpAuthn() {
         dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
     }
 

+ 2 - 4
maxkey-core/src/main/java/org/maxkey/crypto/password/opt/impl/sms/netease/SmsOtpAuthnYunxin.java

@@ -12,7 +12,6 @@ import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.message.BasicNameValuePair;
 import org.apache.http.util.EntityUtils;
 import org.maxkey.crypto.password.opt.impl.SmsOtpAuthn;
-import org.springframework.jdbc.core.JdbcTemplate;
 
 /**
  * 网易云信的短信验证.
@@ -21,9 +20,8 @@ import org.springframework.jdbc.core.JdbcTemplate;
  */
 
 public class SmsOtpAuthnYunxin extends SmsOtpAuthn {
-    public SmsOtpAuthnYunxin(JdbcTemplate jdbcTemplate) {
-        super(jdbcTemplate);
-        // TODO Auto-generated constructor stub
+    public SmsOtpAuthnYunxin() {
+
     }
 
     //发送验证码的请求路径URL

+ 5 - 0
maxkey-core/src/main/java/org/maxkey/crypto/password/opt/token/AbstractOptTokenStore.java

@@ -0,0 +1,5 @@
+package org.maxkey.crypto.password.opt.token;
+
+public class AbstractOptTokenStore {
+
+}

+ 19 - 0
maxkey-core/src/main/java/org/maxkey/crypto/password/opt/token/InMemoryOptTokenStore.java

@@ -0,0 +1,19 @@
+package org.maxkey.crypto.password.opt.token;
+
+import java.time.Duration;
+import org.ehcache.UserManagedCache;
+import org.ehcache.config.builders.ExpiryPolicyBuilder;
+import org.ehcache.config.builders.UserManagedCacheBuilder;
+import org.maxkey.authn.support.rememberme.RemeberMe;
+import org.maxkey.crypto.password.opt.OneTimePassword;
+
+public class InMemoryOptTokenStore {
+    protected static final UserManagedCache<String, OneTimePassword> remeberMeStore = 
+            UserManagedCacheBuilder.newUserManagedCacheBuilder(String.class, OneTimePassword.class)
+                .withExpiry(
+                    ExpiryPolicyBuilder.timeToLiveExpiration(
+                        Duration.ofMinutes(RemeberMe.TWO_WEEK)
+                    )
+                )
+                .build(true);
+}

+ 110 - 0
maxkey-core/src/main/java/org/maxkey/crypto/password/opt/token/JdbcOptTokenStore.java

@@ -0,0 +1,110 @@
+package org.maxkey.crypto.password.opt.token;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.util.Date;
+import org.joda.time.DateTime;
+import org.joda.time.Duration;
+import org.joda.time.format.DateTimeFormat;
+import org.maxkey.constants.ConstantsStatus;
+import org.maxkey.crypto.password.opt.OneTimePassword;
+import org.maxkey.domain.UserInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.core.RowMapper;
+
+public class JdbcOptTokenStore {
+    private static final  Logger logger = LoggerFactory.getLogger(JdbcOptTokenStore.class);
+    
+    private static final String DEFAULT_DEFAULT_INSERT_STATEMENT = 
+            "INSERT INTO ONE_TIME_PASSWORD(ID ,OPTTYPE,USERNAME,TOKEN,RECEIVER,CREATETIME,STATUS)" 
+                    + " VALUES(?,?,?,?,?,?," + ConstantsStatus.ACTIVE + ")";
+
+    private static final String DEFAULT_DEFAULT_SELECT_STATEMENT = 
+            "SELECT ID ,OPTTYPE,USERNAME,TOKEN,RECEIVER,CREATETIME FROM ONE_TIME_PASSWORD"
+            +   " WHERE STATUS =" + ConstantsStatus.ACTIVE 
+            +   " AND  USERNAME = ? AND TOKEN = ? AND OPTTYPE = ?";
+
+    private static final String DEFAULT_DEFAULT_DELETE_STATEMENT = 
+            "UPDATE ONE_TIME_PASSWORD SET  STATUS ="
+            + ConstantsStatus.DELETE + " WHERE USERNAME = ? AND TOKEN = ? AND OPTTYPE = ?";
+    
+    private final JdbcTemplate jdbcTemplate;
+    
+    public JdbcOptTokenStore(JdbcTemplate jdbcTemplate) {
+        this.jdbcTemplate = jdbcTemplate;
+    }
+    
+ 
+    protected void store(UserInfo userInfo, String token, String receiver, int type) {
+        jdbcTemplate.update(DEFAULT_DEFAULT_INSERT_STATEMENT,
+                new Object[] { 
+                        java.util.UUID.randomUUID(), 
+                        type, 
+                        userInfo.getUsername(),
+                        token, 
+                        receiver, 
+                        new Date() 
+                },
+                new int[] { Types.VARCHAR, Types.INTEGER, 
+                        Types.VARCHAR, Types.VARCHAR, 
+                        Types.VARCHAR,Types.TIMESTAMP 
+                }
+        );
+    }
+
+    /**
+     * validate.
+     * @param userInfo UserInfo
+     * @param token String
+     * @param type int
+     * @return
+     */
+    public boolean validate(UserInfo userInfo, String token, int type,int interval) {
+        OneTimePassword oneTimePassword = jdbcTemplate.queryForObject(
+                DEFAULT_DEFAULT_SELECT_STATEMENT,
+                new OneTimePasswordRowMapper(), userInfo.getUsername(), token, type);
+
+        if (oneTimePassword != null) {
+
+            jdbcTemplate.update(
+                    DEFAULT_DEFAULT_DELETE_STATEMENT, 
+                    new Object[] { userInfo.getUsername(), token, type },
+                    new int[] { Types.VARCHAR, Types.VARCHAR, Types.INTEGER }
+            );
+            DateTime currentdateTime = new DateTime();
+            DateTime oneTimePwdData = DateTime.parse(oneTimePassword.getCreateTime(),
+                    DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss"));
+            Duration duration = new Duration(oneTimePwdData, currentdateTime);
+            int intDuration = Integer.parseInt(duration.getStandardSeconds() + "");
+            logger.debug("validate duration " + intDuration);
+            logger.debug("validate result " + (intDuration <= interval));
+            if (intDuration <= interval) {
+                return true;
+            }
+        }
+        return false;
+
+    }
+    
+    public class OneTimePasswordRowMapper implements RowMapper<OneTimePassword> {
+
+        /**
+         *ResultSet.
+         */
+        public OneTimePassword mapRow(ResultSet rs, int rowNum) throws SQLException {
+            OneTimePassword oneTimePassword = new OneTimePassword();
+            oneTimePassword.setId(rs.getString("ID"));
+            oneTimePassword.setType(rs.getInt("OPTTYPE"));
+            oneTimePassword.setUsername(rs.getString("USERNAME"));
+            oneTimePassword.setToken(rs.getString("TOKEN"));
+            oneTimePassword.setUsername(rs.getString("USERNAME"));
+            oneTimePassword.setReceiver(rs.getString("RECEIVER"));
+            oneTimePassword.setCreateTime(rs.getString("CREATETIME"));
+            return oneTimePassword;
+        }
+    }
+
+}

+ 5 - 0
maxkey-core/src/main/java/org/maxkey/crypto/password/opt/token/RedisOptTokenStore.java

@@ -0,0 +1,5 @@
+package org.maxkey.crypto.password.opt.token;
+
+public class RedisOptTokenStore {
+
+}

+ 298 - 371
maxkey-core/src/main/java/org/maxkey/domain/PasswordPolicy.java

@@ -6,9 +6,8 @@ import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.Table;
 import javax.validation.constraints.NotNull;
-
 import org.apache.mybatis.jpa.persistence.JpaBaseDomain;
-import org.maxkey.constants.SERVICEMESSAGE;
+import org.maxkey.constants.ConstantsServiceMessage;
 import org.maxkey.exception.PasswordPolicyException;
 
 /**
@@ -16,376 +15,304 @@ import org.maxkey.exception.PasswordPolicyException;
  *
  */
 
-@Table(name = "PASSWORD_POLICY")  
+@Table(name = "PASSWORD_POLICY")
 public class PasswordPolicy extends JpaBaseDomain implements java.io.Serializable {
-	
-	private static final long serialVersionUID = -4797776994287829182L;
-	@Id
-	@Column
-	@GeneratedValue(strategy=GenerationType.AUTO,generator="uuid")
-	String id;
-	/**
-	 * minimum password lengths
-	 */
-	@NotNull
-	@Column
-	private int minLength;
-	/**
-	 * maximum password lengths
-	 */
-	@NotNull
-	@Column
-	private int maxLength;
-	/**
-	 * least lowercase letter
-	 */
-	@NotNull
-	@Column
-	private int lowerCase;
-	/**
-	 * least  uppercase letter
-	 */
-	@NotNull
-	@Column
-	private int upperCase;
-	/**
-	 * inclusion of numerical digits
-	 */
-	@NotNull
-	@Column
-	private int digits;
-	/**
-	 * inclusion of special characters
-	 */
-	@NotNull
-	@Column
-	private int specialChar;
-	/**
-	 * correct password attempts
-	 */
-	@NotNull
-	@Column
-	private int attempts;
-	/**
-	 * attempts lock Duration
-	 */
-	@NotNull
-	@Column
-	private int duration;
-	/**
-	 * require users to change passwords periodically
-	 */
-	@Column
-	private int expiration;
-	
-	/**
-	 * 0   no
-	 * 1   yes
-	 */
-	@Column
-	private int username;
-	
-	/**
-	 * not include password list
-	 */
-	@Column
-	private String simplePasswords;
-
-
-
-	/**
-	 * @return the minLength
-	 */
-	public int getMinLength() {
-		return minLength;
-	}
-
-
-
-	/**
-	 * @param minLength the minLength to set
-	 */
-	public void setMinLength(int minLength) {
-		this.minLength = minLength;
-	}
-
-
-
-	/**
-	 * @return the maxLength
-	 */
-	public int getMaxLength() {
-		return maxLength;
-	}
-
-
-
-	/**
-	 * @param maxLength the maxLength to set
-	 */
-	public void setMaxLength(int maxLength) {
-		this.maxLength = maxLength;
-	}
-
-
-	/**
-	 * @return the lowerCase
-	 */
-	public int getLowerCase() {
-		return lowerCase;
-	}
-
-
-
-	/**
-	 * @param lowerCase the lowerCase to set
-	 */
-	public void setLowerCase(int lowerCase) {
-		this.lowerCase = lowerCase;
-	}
-
-
-
-	/**
-	 * @return the upperCase
-	 */
-	public int getUpperCase() {
-		return upperCase;
-	}
-
-
-
-	/**
-	 * @param upperCase the upperCase to set
-	 */
-	public void setUpperCase(int upperCase) {
-		this.upperCase = upperCase;
-	}
-
-
-
-	/**
-	 * @return the digits
-	 */
-	public int getDigits() {
-		return digits;
-	}
-
-
-
-	/**
-	 * @param digits the digits to set
-	 */
-	public void setDigits(int digits) {
-		this.digits = digits;
-	}
-
-
-
-	/**
-	 * @return the specialChar
-	 */
-	public int getSpecialChar() {
-		return specialChar;
-	}
-
-
-
-	/**
-	 * @return the id
-	 */
-	public String getId() {
-		return id;
-	}
-
-
-
-	/**
-	 * @param id the id to set
-	 */
-	public void setId(String id) {
-		this.id = id;
-	}
-
-
-
-	/**
-	 * @param specialChar the specialChar to set
-	 */
-	public void setSpecialChar(int specialChar) {
-		this.specialChar = specialChar;
-	}
-
-
-
-	/**
-	 * @return the attempts
-	 */
-	public int getAttempts() {
-		return attempts;
-	}
-
-
-
-	/**
-	 * @param attempts the attempts to set
-	 */
-	public void setAttempts(int attempts) {
-		this.attempts = attempts;
-	}
-
-
-
-
-
-
-	/**
-	 * @return the duration
-	 */
-	public int getDuration() {
-		return duration;
-	}
-
-
-
-	/**
-	 * @param duration the duration to set
-	 */
-	public void setDuration(int duration) {
-		this.duration = duration;
-	}
-
-
-
-	/**
-	 * @return the expiration
-	 */
-	public int getExpiration() {
-		return expiration;
-	}
-
-
-
-	/**
-	 * @param expiration the expiration to set
-	 */
-	public void setExpiration(int expiration) {
-		this.expiration = expiration;
-	}
-
 
+    private static final long serialVersionUID = -4797776994287829182L;
+    @Id
+    @Column
+    @GeneratedValue(strategy = GenerationType.AUTO, generator = "uuid")
+    String id;
+    /**
+     * minimum password lengths
+     */
+    @NotNull
+    @Column
+    private int minLength;
+    /**
+     * maximum password lengths
+     */
+    @NotNull
+    @Column
+    private int maxLength;
+    /**
+     * least lowercase letter
+     */
+    @NotNull
+    @Column
+    private int lowerCase;
+    /**
+     * least uppercase letter
+     */
+    @NotNull
+    @Column
+    private int upperCase;
+    /**
+     * inclusion of numerical digits
+     */
+    @NotNull
+    @Column
+    private int digits;
+    /**
+     * inclusion of special characters
+     */
+    @NotNull
+    @Column
+    private int specialChar;
+    /**
+     * correct password attempts
+     */
+    @NotNull
+    @Column
+    private int attempts;
+    /**
+     * attempts lock Duration
+     */
+    @NotNull
+    @Column
+    private int duration;
+    /**
+     * require users to change passwords periodically
+     */
+    @Column
+    private int expiration;
+
+    /**
+     * 0 no 1 yes
+     */
+    @Column
+    private int username;
+
+    /**
+     * not include password list
+     */
+    @Column
+    private String simplePasswords;
+
+    /**
+     * @return the minLength
+     */
+    public int getMinLength() {
+        return minLength;
+    }
+
+    /**
+     * @param minLength the minLength to set
+     */
+    public void setMinLength(int minLength) {
+        this.minLength = minLength;
+    }
+
+    /**
+     * @return the maxLength
+     */
+    public int getMaxLength() {
+        return maxLength;
+    }
+
+    /**
+     * @param maxLength the maxLength to set
+     */
+    public void setMaxLength(int maxLength) {
+        this.maxLength = maxLength;
+    }
+
+    /**
+     * @return the lowerCase
+     */
+    public int getLowerCase() {
+        return lowerCase;
+    }
+
+    /**
+     * @param lowerCase the lowerCase to set
+     */
+    public void setLowerCase(int lowerCase) {
+        this.lowerCase = lowerCase;
+    }
+
+    /**
+     * @return the upperCase
+     */
+    public int getUpperCase() {
+        return upperCase;
+    }
+
+    /**
+     * @param upperCase the upperCase to set
+     */
+    public void setUpperCase(int upperCase) {
+        this.upperCase = upperCase;
+    }
+
+    /**
+     * @return the digits
+     */
+    public int getDigits() {
+        return digits;
+    }
+
+    /**
+     * @param digits the digits to set
+     */
+    public void setDigits(int digits) {
+        this.digits = digits;
+    }
+
+    /**
+     * @return the specialChar
+     */
+    public int getSpecialChar() {
+        return specialChar;
+    }
+
+    /**
+     * @return the id
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * @param id the id to set
+     */
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    /**
+     * @param specialChar the specialChar to set
+     */
+    public void setSpecialChar(int specialChar) {
+        this.specialChar = specialChar;
+    }
+
+    /**
+     * @return the attempts
+     */
+    public int getAttempts() {
+        return attempts;
+    }
+
+    /**
+     * @param attempts the attempts to set
+     */
+    public void setAttempts(int attempts) {
+        this.attempts = attempts;
+    }
+
+    /**
+     * @return the duration
+     */
+    public int getDuration() {
+        return duration;
+    }
+
+    /**
+     * @param duration the duration to set
+     */
+    public void setDuration(int duration) {
+        this.duration = duration;
+    }
+
+    /**
+     * @return the expiration
+     */
+    public int getExpiration() {
+        return expiration;
+    }
+
+    /**
+     * @param expiration the expiration to set
+     */
+    public void setExpiration(int expiration) {
+        this.expiration = expiration;
+    }
+
+    /**
+     * @return the username
+     */
+    public int getUsername() {
+        return username;
+    }
+
+    /**
+     * @param username the username to set
+     */
+    public void setUsername(int username) {
+        this.username = username;
+    }
+
+    /**
+     * @return the simplePasswords
+     */
+    public String getSimplePasswords() {
+        return simplePasswords;
+    }
+
+    /**
+     * @param simplePasswords the simplePasswords to set
+     */
+    public void setSimplePasswords(String simplePasswords) {
+        this.simplePasswords = simplePasswords;
+    }
+
+    public void check(String username, String newPassword, String oldPassword) throws PasswordPolicyException {
+        if ((1 == this.getUsername()) && newPassword.toLowerCase().contains(username.toLowerCase())) {
+            throw new PasswordPolicyException(ConstantsServiceMessage.PASSWORDPOLICY.XW00000001);
+        }
+        if (oldPassword != null && newPassword.equalsIgnoreCase(oldPassword)) {
+            throw new PasswordPolicyException(ConstantsServiceMessage.PASSWORDPOLICY.XW00000002);
+        }
+        if (newPassword.length() < this.getMinLength()) {
+            throw new PasswordPolicyException(ConstantsServiceMessage.PASSWORDPOLICY.XW00000003, this.getMinLength());
+        }
+        if (newPassword.length() > this.getMaxLength()) {
+            throw new PasswordPolicyException(ConstantsServiceMessage.PASSWORDPOLICY.XW00000004, this.getMaxLength());
+        }
+        int numCount = 0, upperCount = 0, lowerCount = 0, spacil = 0;
+        char[] chPwd = newPassword.toCharArray();
+        for (int i = 0; i < chPwd.length; i++) {
+            char ch = chPwd[i];
+            if (Character.isDigit(ch)) {
+                numCount++;
+                continue;
+            }
+            if (Character.isLowerCase(ch)) {
+                lowerCount++;
+                continue;
+            }
+            if (Character.isUpperCase(ch)) {
+                upperCount++;
+                continue;
+            }
+            spacil++;
+        }
+        if (numCount < this.getDigits()) {
+            throw new PasswordPolicyException(ConstantsServiceMessage.PASSWORDPOLICY.XW00000005, this.getDigits());
+        }
+        if (lowerCount < this.getLowerCase()) {
+            throw new PasswordPolicyException(ConstantsServiceMessage.PASSWORDPOLICY.XW00000006, this.getLowerCase());
+        }
+        if (upperCount < this.getUpperCase()) {
+            throw new PasswordPolicyException(ConstantsServiceMessage.PASSWORDPOLICY.XW00000007, this.getUpperCase());
+        }
+        if (spacil < this.getSpecialChar()) {
+            throw new PasswordPolicyException(ConstantsServiceMessage.PASSWORDPOLICY.XW00000008, this.getSpecialChar());
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        return "PasswordPolicy [minLength=" + minLength + ", maxLength=" + maxLength + ", lowerCase=" + lowerCase
+                + ", upperCase=" + upperCase + ", digits=" + digits + ", specialChar=" + specialChar + ", attempts="
+                + attempts + ", duration=" + duration + ", expiration=" + expiration + ", username=" + username
+                + ", simplePasswords=" + simplePasswords + "]";
+    }
 
-	/**
-	 * @return the username
-	 */
-	public int getUsername() {
-		return username;
-	}
-
-
-
-	/**
-	 * @param username the username to set
-	 */
-	public void setUsername(int username) {
-		this.username = username;
-	}
-
-
-
-	/**
-	 * @return the simplePasswords
-	 */
-	public String getSimplePasswords() {
-		return simplePasswords;
-	}
-
-
-
-	/**
-	 * @param simplePasswords the simplePasswords to set
-	 */
-	public void setSimplePasswords(String simplePasswords) {
-		this.simplePasswords = simplePasswords;
-	}
-
-
-
-	public void check(String username, String newPassword,String oldPassword)
-			throws PasswordPolicyException {
-		if((1==this.getUsername())
-				&&newPassword.toLowerCase().contains(username.toLowerCase())){
-			throw new PasswordPolicyException(
-					SERVICEMESSAGE.PASSWORDPOLICY.XW00000001);
-		}
-		if(oldPassword!=null&&newPassword.equalsIgnoreCase(oldPassword)){
-			throw new PasswordPolicyException(
-					SERVICEMESSAGE.PASSWORDPOLICY.XW00000002);
-		}
-		if (newPassword.length() < this.getMinLength()) {
-			throw new PasswordPolicyException(
-					SERVICEMESSAGE.PASSWORDPOLICY.XW00000003,
-					this.getMinLength());
-		}
-		if (newPassword.length() > this.getMaxLength()) {
-			throw new PasswordPolicyException(
-					SERVICEMESSAGE.PASSWORDPOLICY.XW00000004,
-					this.getMaxLength());
-		}
-		int numCount = 0, upperCount = 0, lowerCount = 0, spacil = 0;
-		char[] chPwd = newPassword.toCharArray();
-		for (int i = 0; i < chPwd.length; i++) {
-			char ch = chPwd[i];
-			if (Character.isDigit(ch)) {
-				numCount++;
-				continue;
-			}
-			if(Character.isLowerCase(ch)){
-				lowerCount++;
-				continue;
-			}
-			if(Character.isUpperCase(ch)){
-				upperCount++;
-				continue;
-			}
-			spacil++;
-		}
-		if(numCount<this.getDigits()){
-			throw new PasswordPolicyException(
-					SERVICEMESSAGE.PASSWORDPOLICY.XW00000005,
-					this.getDigits());
-		}
-		if(lowerCount<this.getLowerCase()){
-			throw new PasswordPolicyException(
-					SERVICEMESSAGE.PASSWORDPOLICY.XW00000006,
-					this.getLowerCase());
-		}
-		if(upperCount<this.getUpperCase()){
-			throw new PasswordPolicyException(
-					SERVICEMESSAGE.PASSWORDPOLICY.XW00000007,
-					this.getUpperCase());
-		}
-		if(spacil<this.getSpecialChar()){
-			throw new PasswordPolicyException(
-					SERVICEMESSAGE.PASSWORDPOLICY.XW00000008,
-					this.getSpecialChar());
-		}
-	}
-
-
-
-	/* (non-Javadoc)
-	 * @see java.lang.Object#toString()
-	 */
-	@Override
-	public String toString() {
-		return "PasswordPolicy [minLength=" + minLength + ", maxLength="
-				+ maxLength + ", lowerCase=" + lowerCase + ", upperCase="
-				+ upperCase + ", digits=" + digits + ", specialChar="
-				+ specialChar + ", attempts=" + attempts + ", duration="
-				+ duration + ", expiration=" + expiration + ", username="
-				+ username + ", simplePasswords=" + simplePasswords + "]";
-	}
-	
-	
 }

+ 2 - 2
maxkey-core/src/main/java/org/maxkey/domain/apps/Apps.java

@@ -10,7 +10,7 @@ import javax.persistence.Id;
 import javax.persistence.Table;
 
 import org.apache.mybatis.jpa.persistence.JpaBaseDomain;
-import org.maxkey.constants.BOOLEAN;
+import org.maxkey.constants.Boolean;
 import org.maxkey.domain.Accounts;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -133,7 +133,7 @@ public class Apps extends JpaBaseDomain implements Serializable{
 	
 	public Apps() {
 		super();
-		isSignature=BOOLEAN.FALSE;
+		isSignature=Boolean.FALSE;
 		credential=CREDENTIALS.NONE;
 	}
 

+ 0 - 2
maxkey-dao/src/main/java/org/maxkey/dao/service/MyProfileService.java

@@ -1,10 +1,8 @@
 package org.maxkey.dao.service;
 
 import org.apache.mybatis.jpa.persistence.JpaBaseService;
-import org.maxkey.constants.OPERATEACTION;
 import org.maxkey.dao.persistence.MyProfileMapper;
 import org.maxkey.domain.UserInfo;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 

+ 3 - 3
maxkey-dao/src/main/java/org/maxkey/dao/service/UserInfoService.java

@@ -2,7 +2,7 @@ package org.maxkey.dao.service;
 
 
 import org.apache.mybatis.jpa.persistence.JpaBaseService;
-import org.maxkey.constants.STATUS;
+import org.maxkey.constants.ConstantsStatus;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.crypto.password.PasswordReciprocal;
 import org.maxkey.dao.persistence.UserInfoMapper;
@@ -154,7 +154,7 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
 	public void locked(UserInfo userInfo) {
 		try {
 			if(userInfo != null && StringUtils.isNotEmpty(userInfo.getId())) {
-				userInfo.setIsLocked(STATUS.STOP);
+				userInfo.setIsLocked(ConstantsStatus.STOP);
 				getMapper().locked(userInfo);
 			}
 		} catch(Exception e) {
@@ -169,7 +169,7 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
 	public void unlock(UserInfo userInfo) {
 		try {
 			if(userInfo != null && StringUtils.isNotEmpty(userInfo.getId())) {
-				userInfo.setIsLocked(STATUS.START);
+				userInfo.setIsLocked(ConstantsStatus.START);
 				userInfo.setBadPasswordCount(0);
 				getMapper().unlock(userInfo);
 			}

+ 10 - 10
maxkey-protocols/maxkey-protocol-authorize/src/main/java/org/maxkey/authz/endpoint/AuthorizeEndpoint.java

@@ -6,7 +6,7 @@ package org.maxkey.authz.endpoint;
 import javax.servlet.http.HttpServletRequest;
 
 
-import org.maxkey.constants.PROTOCOLS;
+import org.maxkey.constants.ConstantsProtocols;
 import org.maxkey.dao.service.AppsCasDetailsService;
 import org.maxkey.domain.apps.Apps;
 import org.maxkey.web.WebConstants;
@@ -37,23 +37,23 @@ public class AuthorizeEndpoint extends AuthorizeBaseEndpoint{
 		Apps  application=getApp(id);
 		WebContext.setAttribute(WebConstants.SINGLE_SIGN_ON_APP_ID, id);
 		
-		if(application.getProtocol().equalsIgnoreCase(PROTOCOLS.EXTEND_API)){
+		if(application.getProtocol().equalsIgnoreCase(ConstantsProtocols.EXTEND_API)){
 			modelAndView=WebContext.forward("/authz/api/"+id);
-		}else if (application.getProtocol().equalsIgnoreCase(PROTOCOLS.FORMBASED)){
+		}else if (application.getProtocol().equalsIgnoreCase(ConstantsProtocols.FORMBASED)){
 			 modelAndView=WebContext.forward("/authz/formbased/"+id);
-		}else if (application.getProtocol().equalsIgnoreCase(PROTOCOLS.OAUTH20)){
+		}else if (application.getProtocol().equalsIgnoreCase(ConstantsProtocols.OAUTH20)){
 			 modelAndView=WebContext.forward("/authz/oauthv20/"+application.getId());
-		}else if (application.getProtocol().equalsIgnoreCase(PROTOCOLS.OPEN_ID_CONNECT)){
+		}else if (application.getProtocol().equalsIgnoreCase(ConstantsProtocols.OPEN_ID_CONNECT)){
 			// modelAndView=new ModelAndView("openid connect");
-		}else if (application.getProtocol().equalsIgnoreCase(PROTOCOLS.SAML20)){
+		}else if (application.getProtocol().equalsIgnoreCase(ConstantsProtocols.SAML20)){
 			 modelAndView=WebContext.forward("/authz/saml20/idpinit/"+application.getId());
-		}else if (application.getProtocol().equalsIgnoreCase(PROTOCOLS.TOKENBASED)){
+		}else if (application.getProtocol().equalsIgnoreCase(ConstantsProtocols.TOKENBASED)){
 			modelAndView=WebContext.forward("/authz/tokenbased/"+id);
-		}else if (application.getProtocol().equalsIgnoreCase(PROTOCOLS.CAS)){
+		}else if (application.getProtocol().equalsIgnoreCase(ConstantsProtocols.CAS)){
 			modelAndView=WebContext.forward("/authz/cas/"+id);
-		}else if (application.getProtocol().equalsIgnoreCase(PROTOCOLS.DESKTOP)){
+		}else if (application.getProtocol().equalsIgnoreCase(ConstantsProtocols.DESKTOP)){
 			modelAndView=WebContext.forward("/authz/desktop/"+id);
-		}else if (application.getProtocol().equalsIgnoreCase(PROTOCOLS.BASIC)){
+		}else if (application.getProtocol().equalsIgnoreCase(ConstantsProtocols.BASIC)){
 			modelAndView=WebContext.redirect(application.getLoginUrl());
 		}
 		

+ 2 - 2
maxkey-protocols/maxkey-protocol-authorize/src/main/java/org/maxkey/authz/endpoint/adapter/AbstractAuthorizeAdapter.java

@@ -2,7 +2,7 @@ package org.maxkey.authz.endpoint.adapter;
 
 import java.io.UnsupportedEncodingException;
 import org.apache.commons.codec.binary.Hex;
-import org.maxkey.constants.BOOLEAN;
+import org.maxkey.constants.Boolean;
 import org.maxkey.crypto.Base64Utils;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.crypto.cert.CertSigner;
@@ -25,7 +25,7 @@ public abstract class AbstractAuthorizeAdapter {
 	public abstract String generateInfo(UserInfo userInfo,Object app);
 	
 	public String  sign(String data,Apps app){
-		if(BOOLEAN.isTrue(app.getIsSignature())){
+		if(Boolean.isTrue(app.getIsSignature())){
 			KeyStoreLoader keyStoreLoader=(KeyStoreLoader)WebContext.getBean("keyStoreLoader");
 			try {	
 				byte[] signature= CertSigner.sign(data.getBytes(), keyStoreLoader.getKeyStore(), keyStoreLoader.getEntityName(), keyStoreLoader.getKeystorePassword());

+ 2 - 2
maxkey-protocols/maxkey-protocol-cas/src/main/java/org/maxkey/authz/cas/endpoint/Cas20AuthorizeEndpoint.java

@@ -15,7 +15,7 @@ import org.maxkey.authz.cas.endpoint.ticket.service.TicketServices;
 import org.maxkey.authz.endpoint.AuthorizeBaseEndpoint;
 import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
 import org.maxkey.config.ApplicationConfig;
-import org.maxkey.constants.BOOLEAN;
+import org.maxkey.constants.Boolean;
 import org.maxkey.dao.service.AppsCasDetailsService;
 import org.maxkey.dao.service.UserInfoService;
 import org.maxkey.domain.UserInfo;
@@ -194,7 +194,7 @@ For all error codes, it is RECOMMENDED that CAS provide a more detailed message
 			_logger.debug("principal "+principal);
 			serviceResponseBuilder.success().setUser(principal);
 			
-			if(BOOLEAN.isTrue(storedTicket.getCasDetails().getIsAdapter())){
+			if(Boolean.isTrue(storedTicket.getCasDetails().getIsAdapter())){
 				AbstractAuthorizeAdapter adapter =(AbstractAuthorizeAdapter)Instance.newInstance(storedTicket.getCasDetails().getAdapter());
 				UserInfo userInfo = (UserInfo) userInfoService.loadByUsername(principal);
 				adapter.generateInfo(userInfo, serviceResponseBuilder);

+ 3 - 3
maxkey-protocols/maxkey-protocol-cas/src/main/java/org/maxkey/authz/cas/endpoint/Cas30AuthorizeEndpoint.java

@@ -14,7 +14,7 @@ import org.maxkey.authz.cas.endpoint.ticket.service.TicketServices;
 import org.maxkey.authz.endpoint.AuthorizeBaseEndpoint;
 import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
 import org.maxkey.config.ApplicationConfig;
-import org.maxkey.constants.BOOLEAN;
+import org.maxkey.constants.Boolean;
 import org.maxkey.dao.service.AppsCasDetailsService;
 import org.maxkey.dao.service.UserInfoService;
 import org.maxkey.domain.UserInfo;
@@ -74,7 +74,7 @@ public class Cas30AuthorizeEndpoint  extends AuthorizeBaseEndpoint{
 			String principal=((BasicAuthentication)storedTicket.getAuthentication().getPrincipal()).getUsername();
 			serviceResponseBuilder.success().setUser(principal);
 			
-			if(BOOLEAN.isTrue(storedTicket.getCasDetails().getIsAdapter())){
+			if(Boolean.isTrue(storedTicket.getCasDetails().getIsAdapter())){
 				AbstractAuthorizeAdapter adapter =(AbstractAuthorizeAdapter)Instance.newInstance(storedTicket.getCasDetails().getAdapter());
 				UserInfo userInfo = (UserInfo) userInfoService.loadByUsername(principal);
 				adapter.generateInfo(userInfo, serviceResponseBuilder);
@@ -114,7 +114,7 @@ public class Cas30AuthorizeEndpoint  extends AuthorizeBaseEndpoint{
 			String principal=((BasicAuthentication)storedTicket.getAuthentication().getPrincipal()).getUsername();
 			serviceResponseBuilder.success().setUser(principal);
 			
-			if(BOOLEAN.isTrue(storedTicket.getCasDetails().getIsAdapter())){
+			if(Boolean.isTrue(storedTicket.getCasDetails().getIsAdapter())){
 				AbstractAuthorizeAdapter adapter =(AbstractAuthorizeAdapter)Instance.newInstance(storedTicket.getCasDetails().getAdapter());
 				UserInfo userInfo = (UserInfo) userInfoService.loadByUsername(principal);
 				adapter.generateInfo(userInfo, serviceResponseBuilder);

+ 2 - 2
maxkey-protocols/maxkey-protocol-desktop/src/main/java/org/maxkey/authz/desktop/endpoint/DesktopAuthorizeEndpoint.java

@@ -8,7 +8,7 @@ import javax.servlet.http.HttpServletRequest;
 import org.maxkey.authz.desktop.endpoint.adapter.DesktopDefaultAdapter;
 import org.maxkey.authz.endpoint.AuthorizeBaseEndpoint;
 import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
-import org.maxkey.constants.BOOLEAN;
+import org.maxkey.constants.Boolean;
 import org.maxkey.dao.service.AppsDesktopDetailsService;
 import org.maxkey.domain.Accounts;
 import org.maxkey.domain.apps.AppsDesktopDetails;
@@ -51,7 +51,7 @@ public class DesktopAuthorizeEndpoint  extends AuthorizeBaseEndpoint{
 			ModelAndView modelAndView=new ModelAndView();
 			
 			AbstractAuthorizeAdapter adapter;
-			if(BOOLEAN.isTrue(desktopDetails.getIsAdapter())){
+			if(Boolean.isTrue(desktopDetails.getIsAdapter())){
 				adapter =(AbstractAuthorizeAdapter)Instance.newInstance(desktopDetails.getAdapter());
 			}else{
 				adapter =(AbstractAuthorizeAdapter)defaultDesktopAdapter;

+ 2 - 2
maxkey-protocols/maxkey-protocol-extendapi/src/main/java/org/maxkey/authz/exapi/endpoint/ExtendApiAuthorizeEndpoint.java

@@ -7,7 +7,7 @@ import javax.servlet.http.HttpServletRequest;
 
 import org.maxkey.authz.endpoint.AuthorizeBaseEndpoint;
 import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
-import org.maxkey.constants.BOOLEAN;
+import org.maxkey.constants.Boolean;
 import org.maxkey.domain.Accounts;
 import org.maxkey.domain.apps.Apps;
 import org.maxkey.util.Instance;
@@ -33,7 +33,7 @@ public class ExtendApiAuthorizeEndpoint  extends AuthorizeBaseEndpoint{
 		Apps apps=getApp(id);
 		_logger.debug(""+apps);
 		
-		if(BOOLEAN.isTrue(apps.getIsAdapter())){
+		if(Boolean.isTrue(apps.getIsAdapter())){
 			Accounts appUser=getAccounts(apps);
 			
 			if(appUser	==	null){

+ 2 - 2
maxkey-protocols/maxkey-protocol-formbased/src/main/java/org/maxkey/authz/formbased/endpoint/FormBasedAuthorizeEndpoint.java

@@ -8,7 +8,7 @@ import javax.servlet.http.HttpServletRequest;
 import org.maxkey.authz.endpoint.AuthorizeBaseEndpoint;
 import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
 import org.maxkey.authz.formbased.endpoint.adapter.FormBasedDefaultAdapter;
-import org.maxkey.constants.BOOLEAN;
+import org.maxkey.constants.Boolean;
 import org.maxkey.dao.service.AppsFormBasedDetailsService;
 import org.maxkey.domain.Accounts;
 import org.maxkey.domain.apps.Apps;
@@ -60,7 +60,7 @@ public class FormBasedAuthorizeEndpoint  extends AuthorizeBaseEndpoint{
 			
 			AbstractAuthorizeAdapter adapter;
 			
-			if(BOOLEAN.isTrue(formBasedDetails.getIsAdapter())){
+			if(Boolean.isTrue(formBasedDetails.getIsAdapter())){
 				adapter =(AbstractAuthorizeAdapter)Instance.newInstance(formBasedDetails.getAdapter());
 			}else{
 				adapter =(AbstractAuthorizeAdapter)defaultFormBasedAdapter;

+ 2 - 2
maxkey-protocols/maxkey-protocol-formbased/src/main/java/org/maxkey/authz/formbased/endpoint/adapter/FormBasedDefaultAdapter.java

@@ -1,7 +1,7 @@
 package org.maxkey.authz.formbased.endpoint.adapter;
 
 import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
-import org.maxkey.constants.BOOLEAN;
+import org.maxkey.constants.Boolean;
 import org.maxkey.crypto.DigestUtils;
 import org.maxkey.domain.UserInfo;
 import org.maxkey.domain.apps.AppsFormBasedDetails;
@@ -28,7 +28,7 @@ public class FormBasedDefaultAdapter extends AbstractAuthorizeAdapter {
 		modelAndView.addObject("username", details.getAppUser().getRelatedUsername());
 		modelAndView.addObject("password",  details.getAppUser().getRelatedPassword());
 		
-		if(BOOLEAN.isTrue(details.getIsExtendAttr())){
+		if(Boolean.isTrue(details.getIsExtendAttr())){
 			modelAndView.addObject("extendAttr", details.getExtendAttr());
 			modelAndView.addObject("isExtendAttr", true);
 		}else{

+ 2 - 2
maxkey-protocols/maxkey-protocol-formbased/src/main/java/org/maxkey/authz/formbased/endpoint/adapter/FormBasedNetease163EmailAdapter.java

@@ -1,7 +1,7 @@
 package org.maxkey.authz.formbased.endpoint.adapter;
 
 import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
-import org.maxkey.constants.BOOLEAN;
+import org.maxkey.constants.Boolean;
 import org.maxkey.domain.UserInfo;
 import org.maxkey.domain.apps.AppsFormBasedDetails;
 import org.springframework.web.servlet.ModelAndView;
@@ -27,7 +27,7 @@ public class FormBasedNetease163EmailAdapter extends AbstractAuthorizeAdapter {
 		modelAndView.addObject("email", details.getAppUser().getRelatedUsername());
 		modelAndView.addObject("password",  details.getAppUser().getRelatedPassword());
 		
-		if(BOOLEAN.isTrue(details.getIsExtendAttr())){
+		if(Boolean.isTrue(details.getIsExtendAttr())){
 			modelAndView.addObject("extendAttr", details.getExtendAttr());
 			modelAndView.addObject("isExtendAttr", true);
 		}else{

+ 2 - 2
maxkey-protocols/maxkey-protocol-formbased/src/main/java/org/maxkey/authz/formbased/endpoint/adapter/FormBasedRedirectAdapter.java

@@ -1,7 +1,7 @@
 package org.maxkey.authz.formbased.endpoint.adapter;
 
 import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
-import org.maxkey.constants.BOOLEAN;
+import org.maxkey.constants.Boolean;
 import org.maxkey.crypto.DigestUtils;
 import org.maxkey.domain.UserInfo;
 import org.maxkey.domain.apps.AppsFormBasedDetails;
@@ -61,7 +61,7 @@ public class FormBasedRedirectAdapter extends AbstractAuthorizeAdapter {
 		}
 		
 		
-		if(BOOLEAN.isTrue(details.getIsExtendAttr())){
+		if(Boolean.isTrue(details.getIsExtendAttr())){
 			modelAndView.addObject("extendAttr", details.getExtendAttr());
 			modelAndView.addObject("isExtendAttr", true);
 		}else{

+ 2 - 2
maxkey-protocols/maxkey-protocol-oauth-2.0/src/main/java/org/maxkey/authz/oauth2/provider/userinfo/endpoint/UserInfoEndpoint.java

@@ -11,7 +11,7 @@ import org.maxkey.authz.oauth2.common.exceptions.OAuth2Exception;
 import org.maxkey.authz.oauth2.provider.ClientDetailsService;
 import org.maxkey.authz.oauth2.provider.OAuth2Authentication;
 import org.maxkey.authz.oauth2.provider.token.DefaultTokenServices;
-import org.maxkey.constants.BOOLEAN;
+import org.maxkey.constants.Boolean;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.crypto.jwt.encryption.service.JwtEncryptionAndDecryptionService;
 import org.maxkey.crypto.jwt.encryption.service.impl.RecipientJwtEncryptionAndDecryptionServiceBuilder;
@@ -106,7 +106,7 @@ public class UserInfoEndpoint {
 				 String userJson="";
 				 
 				 AbstractAuthorizeAdapter adapter;
-				 if(BOOLEAN.isTrue(app.getIsAdapter())){
+				 if(Boolean.isTrue(app.getIsAdapter())){
 					adapter =(AbstractAuthorizeAdapter)Instance.newInstance(app.getAdapter());
 				 }else{
 					adapter =(AbstractAuthorizeAdapter)defaultOAuthUserInfoAdapter;

+ 2 - 2
maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/consumer/endpoint/ConsumerEndpoint.java

@@ -23,7 +23,7 @@ import org.maxkey.authz.saml20.consumer.spring.IdentityProviderAuthenticationExc
 import org.maxkey.authz.saml20.consumer.spring.ServiceProviderAuthenticationException;
 import org.maxkey.authz.saml20.provider.xml.AuthnResponseGenerator;
 import org.maxkey.authz.saml20.xml.SAML2ValidatorSuite;
-import org.maxkey.constants.LOGINTYPE;
+import org.maxkey.constants.ConstantsLoginType;
 import org.maxkey.crypto.keystore.KeyStoreLoader;
 import org.maxkey.dao.service.AppsSaml20DetailsService;
 import org.maxkey.domain.apps.AppsSAML20Details;
@@ -161,7 +161,7 @@ public class ConsumerEndpoint {
 	
 		logger.debug("assertion.getID() ", assertion.getAuthnStatements());
 		
-		WebContext.setAuthentication(username, LOGINTYPE.SAMLTRUST,"","","success");
+		WebContext.setAuthentication(username, ConstantsLoginType.SAMLTRUST,"","","success");
 
 		ModelAndView mav = new ModelAndView();
 		mav.addObject("username", username);

+ 2 - 2
maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/provider/xml/AttributeStatementGenerator.java

@@ -7,7 +7,7 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.Map.Entry;
 
-import org.maxkey.constants.BOOLEAN;
+import org.maxkey.constants.Boolean;
 import org.maxkey.domain.ExtraAttr;
 import org.maxkey.domain.ExtraAttrs;
 import org.maxkey.domain.apps.AppsSAML20Details;
@@ -57,7 +57,7 @@ public class AttributeStatementGenerator {
 		}
 		
 		logger.debug("ExtendAttr "+saml20Details.getExtendAttr());
-		if(BOOLEAN.isTrue(saml20Details.getIsExtendAttr())) {
+		if(Boolean.isTrue(saml20Details.getIsExtendAttr())) {
 			ExtraAttrs extraAttrs=new ExtraAttrs(saml20Details.getExtendAttr());
 			for(ExtraAttr extraAttr : extraAttrs.getExtraAttrs()) {
 				logger.debug("Attribute : "+extraAttr.getAttr()+" , Vale : "+extraAttr.getValue()+" , Type : "+extraAttr.getType());

+ 2 - 2
maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/provider/xml/AuthnResponseGenerator.java

@@ -8,7 +8,7 @@ import org.maxkey.authz.saml.service.IDService;
 import org.maxkey.authz.saml.service.TimeService;
 import org.maxkey.authz.saml20.binding.BindingAdapter;
 import org.maxkey.authz.saml20.xml.IssuerGenerator;
-import org.maxkey.constants.BOOLEAN;
+import org.maxkey.constants.Boolean;
 import org.maxkey.domain.apps.AppsSAML20Details;
 import org.opensaml.Configuration;
 import org.opensaml.saml2.core.Assertion;
@@ -61,7 +61,7 @@ public class AuthnResponseGenerator {
 											attributeMap);
 		
 		//Encrypt 
-		if(BOOLEAN.isTrue(saml20Details.getEncrypted())) {
+		if(Boolean.isTrue(saml20Details.getEncrypted())) {
 			logger.info("begin to encrypt assertion");
 			try {
 				// Assume this contains a recipient's RSA public

+ 2 - 2
maxkey-protocols/maxkey-protocol-tokenbased/src/main/java/org/maxkey/authz/token/endpoint/TokenBasedAuthorizeEndpoint.java

@@ -11,7 +11,7 @@ import org.maxkey.authz.endpoint.AuthorizeBaseEndpoint;
 import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
 import org.maxkey.authz.token.endpoint.adapter.TokenBasedDefaultAdapter;
 import org.maxkey.config.ApplicationConfig;
-import org.maxkey.constants.BOOLEAN;
+import org.maxkey.constants.Boolean;
 import org.maxkey.dao.service.AppsTokenBasedDetailsService;
 import org.maxkey.domain.apps.Apps;
 import org.maxkey.domain.apps.AppsTokenBasedDetails;
@@ -58,7 +58,7 @@ public class TokenBasedAuthorizeEndpoint  extends AuthorizeBaseEndpoint{
 		tokenBasedDetails.setIsAdapter(application.getIsAdapter());
 		
 		AbstractAuthorizeAdapter adapter;
-		if(BOOLEAN.isTrue(tokenBasedDetails.getIsAdapter())){
+		if(Boolean.isTrue(tokenBasedDetails.getIsAdapter())){
 			adapter =(AbstractAuthorizeAdapter)Instance.newInstance(tokenBasedDetails.getAdapter());
 		}else{
 			adapter =(AbstractAuthorizeAdapter)defaultTokenBasedAdapter;

+ 8 - 8
maxkey-protocols/maxkey-protocol-tokenbased/src/main/java/org/maxkey/authz/token/endpoint/adapter/TokenBasedDefaultAdapter.java

@@ -4,7 +4,7 @@ import java.util.Date;
 import java.util.HashMap;
 
 import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
-import org.maxkey.constants.BOOLEAN;
+import org.maxkey.constants.Boolean;
 import org.maxkey.domain.UserInfo;
 import org.maxkey.domain.apps.AppsTokenBasedDetails;
 import org.maxkey.util.DateUtils;
@@ -23,25 +23,25 @@ public class TokenBasedDefaultAdapter extends AbstractAuthorizeAdapter {
 		
 		beanMap.put("randomId",(new StringGenerator()).uuidGenerate());
 		
-		if(BOOLEAN.isTrue(details.getUid())){
+		if(Boolean.isTrue(details.getUid())){
 			beanMap.put("uid",userInfo.getId());
 		}
-		if(BOOLEAN.isTrue(details.getUsername())){
+		if(Boolean.isTrue(details.getUsername())){
 			beanMap.put("username", userInfo.getUsername());	
 		}
-		if(BOOLEAN.isTrue(details.getEmail())){
+		if(Boolean.isTrue(details.getEmail())){
 			beanMap.put("email", userInfo.getEmail());
 		}
-		if(BOOLEAN.isTrue(details.getWindowsAccount())){
+		if(Boolean.isTrue(details.getWindowsAccount())){
 			beanMap.put("windowsAccount", userInfo.getWindowsAccount());
 		}
-		if(BOOLEAN.isTrue(details.getEmployeeNumber())){
+		if(Boolean.isTrue(details.getEmployeeNumber())){
 			beanMap.put("employeeNumber", userInfo.getEmployeeNumber());
 		}
-		if(BOOLEAN.isTrue(details.getDepartmentId())){
+		if(Boolean.isTrue(details.getDepartmentId())){
 			beanMap.put("departmentId", userInfo.getDepartmentId());
 		}
-		if(BOOLEAN.isTrue(details.getDepartment())){
+		if(Boolean.isTrue(details.getDepartment())){
 			beanMap.put("department", userInfo.getDepartment());
 		}
 		

+ 7 - 7
maxkey-protocols/maxkey-protocol-tokenbased/src/main/java/org/maxkey/authz/token/endpoint/adapter/TokenBasedSimpleAdapter.java

@@ -3,7 +3,7 @@ package org.maxkey.authz.token.endpoint.adapter;
 import java.util.Date;
 
 import org.maxkey.authz.endpoint.adapter.AbstractAuthorizeAdapter;
-import org.maxkey.constants.BOOLEAN;
+import org.maxkey.constants.Boolean;
 import org.maxkey.domain.UserInfo;
 import org.maxkey.domain.apps.AppsTokenBasedDetails;
 import org.maxkey.util.DateUtils;
@@ -19,17 +19,17 @@ public class TokenBasedSimpleAdapter extends AbstractAuthorizeAdapter {
 	
 		String tokenUsername="";
 		
-		if(BOOLEAN.isTrue(details.getUid())){
+		if(Boolean.isTrue(details.getUid())){
 			tokenUsername=userInfo.getId();
-		}else if(BOOLEAN.isTrue(details.getUsername())){
+		}else if(Boolean.isTrue(details.getUsername())){
 			tokenUsername= userInfo.getUsername();	
-		}else if(BOOLEAN.isTrue(details.getEmail())){
+		}else if(Boolean.isTrue(details.getEmail())){
 			tokenUsername=userInfo.getEmail();
-		}else if(BOOLEAN.isTrue(details.getWindowsAccount())){
+		}else if(Boolean.isTrue(details.getWindowsAccount())){
 			tokenUsername= userInfo.getWindowsAccount();
-		}else if(BOOLEAN.isTrue(details.getEmployeeNumber())){
+		}else if(Boolean.isTrue(details.getEmployeeNumber())){
 			tokenUsername=userInfo.getEmployeeNumber();
-		}else if(BOOLEAN.isTrue(details.getDepartmentId())){
+		}else if(Boolean.isTrue(details.getDepartmentId())){
 			tokenUsername= userInfo.getDepartmentId();
 		}
 		

+ 11 - 11
maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/ApplicationsController.java

@@ -2,7 +2,7 @@ package org.maxkey.web.apps.contorller;
 
 
 import org.apache.mybatis.jpa.persistence.JpaPageResults;
-import org.maxkey.constants.OPERATEMESSAGE;
+import org.maxkey.constants.ConstantsOperateMessage;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.domain.ExtraAttr;
 import org.maxkey.domain.ExtraAttrs;
@@ -62,10 +62,10 @@ public class ApplicationsController extends BaseAppContorller {
 		transform(application);
 		
 		if (appsService.insert(application)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.error);
 		}
 		
 	}
@@ -92,10 +92,10 @@ public class ApplicationsController extends BaseAppContorller {
 		}
 		
 		if (appsService.updateExtendAttr(application)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_ERROR),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error);
 		}
 	}
 	
@@ -109,10 +109,10 @@ public class ApplicationsController extends BaseAppContorller {
 	public Message query(@ModelAttribute("application") Apps application) {
 		_logger.debug("-query  :" + application);
 		if (appsService.load(application)!=null) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_ERROR),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error);
 		}
 		
 	}
@@ -127,10 +127,10 @@ public class ApplicationsController extends BaseAppContorller {
 	public Message update(@ModelAttribute("application") Apps application) {
 		_logger.debug("-update  application :" + application);
 		if (appsService.update(application)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 		}
 		
 	}
@@ -141,10 +141,10 @@ public class ApplicationsController extends BaseAppContorller {
 	public Message delete(@ModelAttribute("application") Apps application) {
 		_logger.debug("-delete  application :" + application);
 		if (appsService.delete(application)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.error);
 		}
 		
 	}

+ 3 - 3
maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/BaseAppContorller.java

@@ -5,7 +5,7 @@ package org.maxkey.web.apps.contorller;
 
 import java.io.IOException;
 
-import org.maxkey.constants.PROTOCOLS;
+import org.maxkey.constants.ConstantsProtocols;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.crypto.password.PasswordReciprocal;
 import org.maxkey.dao.service.AppsService;
@@ -65,7 +65,7 @@ public class BaseAppContorller {
 	
 	protected void encodeSharedPassword(Apps application){
 		if(application.getCredential()!=Apps.CREDENTIALS.SHARED){
-			if(application.getProtocol().equals(PROTOCOLS.DESKTOP)||application.getProtocol().equals(PROTOCOLS.FORMBASED)){
+			if(application.getProtocol().equals(ConstantsProtocols.DESKTOP)||application.getProtocol().equals(ConstantsProtocols.FORMBASED)){
 				if(StringUtils.isNotEmpty(application.getSharedPassword())){
 					application.setSharedPassword(ReciprocalUtils.encode(application.getSharedPassword()));
 				}
@@ -75,7 +75,7 @@ public class BaseAppContorller {
 	
 	protected void decoderSharedPassword(Apps application){
 		if(application.getCredential()!=Apps.CREDENTIALS.SHARED){
-			if(application.getProtocol().equals(PROTOCOLS.DESKTOP)||application.getProtocol().equals(PROTOCOLS.FORMBASED)){
+			if(application.getProtocol().equals(ConstantsProtocols.DESKTOP)||application.getProtocol().equals(ConstantsProtocols.FORMBASED)){
 				if(StringUtils.isNotEmpty(application.getSharedPassword())){
 					application.setSharedPassword(ReciprocalUtils.decoder(application.getSharedPassword()));
 				}

+ 9 - 9
maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/BasicDetailsController.java

@@ -2,8 +2,8 @@ package org.maxkey.web.apps.contorller;
 
 import java.util.List;
 
-import org.maxkey.constants.OPERATEMESSAGE;
-import org.maxkey.constants.PROTOCOLS;
+import org.maxkey.constants.ConstantsOperateMessage;
+import org.maxkey.constants.ConstantsProtocols;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.domain.apps.Apps;
 import org.maxkey.web.WebContext;
@@ -30,7 +30,7 @@ public class BasicDetailsController  extends BaseAppContorller {
 		ModelAndView modelAndView=new ModelAndView("apps/basic/appAdd");
 		Apps appDetails =new Apps();
 		appDetails.setId(appDetails.generateId());
-		appDetails.setProtocol(PROTOCOLS.BASIC);
+		appDetails.setProtocol(ConstantsProtocols.BASIC);
 		appDetails.setSecret(ReciprocalUtils.generateKey(ReciprocalUtils.Algorithm.DES));
 		modelAndView.addObject("model",appDetails);
 		return modelAndView;
@@ -44,10 +44,10 @@ public class BasicDetailsController  extends BaseAppContorller {
 		transform(appDetails);
 		
 		if (appsService.insert(appDetails)) {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
 			
 		} else {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.error);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.error);
 		}
 		return   WebContext.forward("forwardUpdate/"+appDetails.getId());
 	}
@@ -74,10 +74,10 @@ public class BasicDetailsController  extends BaseAppContorller {
 		transform(appDetails);
 
 		if (appsService.update(appDetails)) {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
 			
 		} else {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 		}
 		return   WebContext.forward("forwardUpdate/"+appDetails.getId());
 	}
@@ -88,10 +88,10 @@ public class BasicDetailsController  extends BaseAppContorller {
 	public Message delete(@PathVariable("id") String id) {
 		_logger.debug("-delete  application :" + id);
 		if (appsService.remove(id)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.error);
 		}
 	}
 	

+ 9 - 9
maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/CasDetailsController.java

@@ -1,7 +1,7 @@
 package org.maxkey.web.apps.contorller;
 
-import org.maxkey.constants.OPERATEMESSAGE;
-import org.maxkey.constants.PROTOCOLS;
+import org.maxkey.constants.ConstantsOperateMessage;
+import org.maxkey.constants.ConstantsProtocols;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.dao.service.AppsCasDetailsService;
 import org.maxkey.domain.apps.AppsCasDetails;
@@ -32,7 +32,7 @@ public class CasDetailsController  extends BaseAppContorller {
 		ModelAndView modelAndView=new ModelAndView("apps/cas/appAdd");
 		AppsCasDetails casDetails =new AppsCasDetails();
 		casDetails.setId(casDetails.generateId());
-		casDetails.setProtocol(PROTOCOLS.CAS);
+		casDetails.setProtocol(ConstantsProtocols.CAS);
 		casDetails.setSecret(ReciprocalUtils.generateKey(ReciprocalUtils.Algorithm.DES));
 		modelAndView.addObject("model",casDetails);
 		return modelAndView;
@@ -46,10 +46,10 @@ public class CasDetailsController  extends BaseAppContorller {
 		transform(casDetails);
 		
 		if (casDetailsService.insert(casDetails)&&appsService.insertApp(casDetails)) {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
 			
 		} else {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.error);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.error);
 		}
 		return   WebContext.forward("forwardUpdate/"+casDetails.getId());
 	}
@@ -77,10 +77,10 @@ public class CasDetailsController  extends BaseAppContorller {
 		transform(casDetails);
 
 		if (casDetailsService.update(casDetails)&&appsService.updateApp(casDetails)) {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
 			
 		} else {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 		}
 		return   WebContext.forward("forwardUpdate/"+casDetails.getId());
 	}
@@ -91,10 +91,10 @@ public class CasDetailsController  extends BaseAppContorller {
 	public Message delete(@PathVariable("id") String id) {
 		_logger.debug("-delete  application :" + id);
 		if (casDetailsService.remove(id)&&appsService.remove(id)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.error);
 		}
 	}
 	

+ 9 - 9
maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/DesktopDetailsController.java

@@ -2,8 +2,8 @@ package org.maxkey.web.apps.contorller;
 
 import java.util.List;
 
-import org.maxkey.constants.OPERATEMESSAGE;
-import org.maxkey.constants.PROTOCOLS;
+import org.maxkey.constants.ConstantsOperateMessage;
+import org.maxkey.constants.ConstantsProtocols;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.dao.service.AppsDesktopDetailsService;
 import org.maxkey.domain.apps.AppsDesktopDetails;
@@ -34,7 +34,7 @@ public class DesktopDetailsController  extends BaseAppContorller {
 		ModelAndView modelAndView=new ModelAndView("apps/desktop/appAdd");
 		AppsDesktopDetails desktopDetails=new AppsDesktopDetails();
 		desktopDetails.setId(desktopDetails.generateId());
-		desktopDetails.setProtocol(PROTOCOLS.DESKTOP);
+		desktopDetails.setProtocol(ConstantsProtocols.DESKTOP);
 		desktopDetails.setSecret(ReciprocalUtils.generateKey(""));
 
 		modelAndView.addObject("model",desktopDetails);
@@ -50,10 +50,10 @@ public class DesktopDetailsController  extends BaseAppContorller {
 		transform(desktopDetails);
 		desktopDetailsService.insert(desktopDetails);
 		if (appsService.insertApp(desktopDetails)) {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
 			
 		} else {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.error);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.error);
 		}
 		return   WebContext.forward("forwardUpdate/"+desktopDetails.getId());
 	}
@@ -82,10 +82,10 @@ public class DesktopDetailsController  extends BaseAppContorller {
 		transform(desktopDetails);
 
 		if (desktopDetailsService.update(desktopDetails)&&appsService.updateApp(desktopDetails)) {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
 			
 		} else {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 		}
 		return   WebContext.forward("forwardUpdate/"+desktopDetails.getId());
 	}
@@ -95,10 +95,10 @@ public class DesktopDetailsController  extends BaseAppContorller {
 	public Message delete(@PathVariable("id") String id) {
 		_logger.debug("-delete  application :" + id);
 		if (desktopDetailsService.remove(id)&&appsService.remove(id)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.error);
 		}
 	}
 	

+ 9 - 9
maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/ExtendApiDetailsController.java

@@ -2,8 +2,8 @@ package org.maxkey.web.apps.contorller;
 
 import java.util.List;
 
-import org.maxkey.constants.OPERATEMESSAGE;
-import org.maxkey.constants.PROTOCOLS;
+import org.maxkey.constants.ConstantsOperateMessage;
+import org.maxkey.constants.ConstantsProtocols;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.domain.apps.Apps;
 import org.maxkey.domain.apps.AppsExtendApiDetails;
@@ -32,7 +32,7 @@ public class ExtendApiDetailsController  extends BaseAppContorller {
 		ModelAndView modelAndView=new ModelAndView("apps/extendapi/appAdd");
 		AppsExtendApiDetails extendApiDetails=new AppsExtendApiDetails();
 		extendApiDetails.setId(extendApiDetails.generateId());
-		extendApiDetails.setProtocol(PROTOCOLS.EXTEND_API);
+		extendApiDetails.setProtocol(ConstantsProtocols.EXTEND_API);
 		extendApiDetails.setSecret(ReciprocalUtils.generateKey(""));
 
 		modelAndView.addObject("model",extendApiDetails);
@@ -46,10 +46,10 @@ public class ExtendApiDetailsController  extends BaseAppContorller {
 		transform(extendApiDetails);
 		
 		if (appsService.insert(extendApiDetails)) {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
 			
 		} else {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.error);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.error);
 		}
 		return   WebContext.forward("forwardUpdate/"+extendApiDetails.getId());
 	}
@@ -79,10 +79,10 @@ public class ExtendApiDetailsController  extends BaseAppContorller {
 		transform(extendApiDetails);
 		
 		if (appsService.update(extendApiDetails)) {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
 			
 		} else {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 		}
 		return   WebContext.forward("forwardUpdate/"+extendApiDetails.getId());
 	}
@@ -93,10 +93,10 @@ public class ExtendApiDetailsController  extends BaseAppContorller {
 	public Message delete(@PathVariable("id") String id) {
 		_logger.debug("-delete  application :" + id);
 		if (appsService.remove(id)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.error);
 		}
 	}
 

+ 9 - 9
maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/FormBasedDetailsController.java

@@ -2,8 +2,8 @@ package org.maxkey.web.apps.contorller;
 
 import java.util.List;
 
-import org.maxkey.constants.OPERATEMESSAGE;
-import org.maxkey.constants.PROTOCOLS;
+import org.maxkey.constants.ConstantsOperateMessage;
+import org.maxkey.constants.ConstantsProtocols;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.dao.service.AppsFormBasedDetailsService;
 import org.maxkey.domain.apps.AppsFormBasedDetails;
@@ -35,7 +35,7 @@ public class FormBasedDetailsController  extends BaseAppContorller {
 		ModelAndView modelAndView=new ModelAndView("apps/formbased/appAdd");
 		AppsFormBasedDetails formBasedDetails=new AppsFormBasedDetails();
 		formBasedDetails.setId(formBasedDetails.generateId());
-		formBasedDetails.setProtocol(PROTOCOLS.FORMBASED);
+		formBasedDetails.setProtocol(ConstantsProtocols.FORMBASED);
 		formBasedDetails.setSecret(ReciprocalUtils.generateKey(""));
 
 		modelAndView.addObject("model",formBasedDetails);
@@ -51,10 +51,10 @@ public class FormBasedDetailsController  extends BaseAppContorller {
 		transform(formBasedDetails);
 		
 		if (formBasedDetailsService.insert(formBasedDetails)&&appsService.insertApp(formBasedDetails)) {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
 			
 		} else {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.error);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.error);
 		}
 		return   WebContext.forward("forwardUpdate/"+formBasedDetails.getId());
 	}
@@ -81,10 +81,10 @@ public class FormBasedDetailsController  extends BaseAppContorller {
 		_logger.debug("-update  application :" + formBasedDetails);
 		transform(formBasedDetails);
 		if (formBasedDetailsService.update(formBasedDetails)&&appsService.updateApp(formBasedDetails)) {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
 			
 		} else {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 		}
 		return   WebContext.forward("forwardUpdate/"+formBasedDetails.getId());
 	}
@@ -95,10 +95,10 @@ public class FormBasedDetailsController  extends BaseAppContorller {
 	public Message delete(@PathVariable("id") String id) {
 		_logger.debug("-delete  application :" + id);
 		if (formBasedDetailsService.remove(id)&&appsService.remove(id)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_ERROR),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_ERROR),MessageType.error);
 		}
 	}
 }

+ 9 - 9
maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/OAuth20DetailsController.java

@@ -3,8 +3,8 @@ package org.maxkey.web.apps.contorller;
 import java.util.List;
 
 import org.maxkey.authz.oauth2.provider.client.JdbcClientDetailsService;
-import org.maxkey.constants.OPERATEMESSAGE;
-import org.maxkey.constants.PROTOCOLS;
+import org.maxkey.constants.ConstantsOperateMessage;
+import org.maxkey.constants.ConstantsProtocols;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.domain.apps.Apps;
 import org.maxkey.domain.apps.AppsOAuth20Details;
@@ -40,7 +40,7 @@ public class OAuth20DetailsController  extends BaseAppContorller {
 		oauth20Details.setSecret(ReciprocalUtils.generateKey(""));
 		oauth20Details.setClientId(oauth20Details.getId());
 		oauth20Details.setClientSecret(oauth20Details.getSecret());
-		oauth20Details.setProtocol(PROTOCOLS.OAUTH20);
+		oauth20Details.setProtocol(ConstantsProtocols.OAUTH20);
 		modelAndView.addObject("model",oauth20Details);
 		return modelAndView;
 	}
@@ -56,10 +56,10 @@ public class OAuth20DetailsController  extends BaseAppContorller {
 		
 		oauth20JdbcClientDetailsService.addClientDetails(oauth20Details.clientDetailsRowMapper());
 		if (appsService.insertApp(oauth20Details)) {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
 			
 		} else {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.error);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.error);
 		}
 		return   WebContext.forward("forwardUpdate/"+oauth20Details.getId());
 	}
@@ -94,9 +94,9 @@ public class OAuth20DetailsController  extends BaseAppContorller {
 		oauth20JdbcClientDetailsService.updateClientDetails(oauth20Details.clientDetailsRowMapper());
 		oauth20JdbcClientDetailsService.updateClientSecret(oauth20Details.getClientId(), oauth20Details.getClientSecret());
 		if (appsService.updateApp(oauth20Details)) {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
 		} else {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 		}
 		return   WebContext.forward("forwardUpdate/"+oauth20Details.getId());
 	}
@@ -108,10 +108,10 @@ public class OAuth20DetailsController  extends BaseAppContorller {
 		_logger.debug("-delete  application :" + id);
 		oauth20JdbcClientDetailsService.removeClientDetails(id);
 		if (appsService.remove(id)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.error);
 		}
 	}
 	

+ 9 - 9
maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/SAML20DetailsController.java

@@ -7,8 +7,8 @@ import java.security.cert.X509Certificate;
 import java.util.List;
 
 import org.maxkey.authz.saml20.metadata.MetadataDescriptorUtil;
-import org.maxkey.constants.OPERATEMESSAGE;
-import org.maxkey.constants.PROTOCOLS;
+import org.maxkey.constants.ConstantsOperateMessage;
+import org.maxkey.constants.ConstantsProtocols;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.crypto.cert.NameUtil;
 import org.maxkey.crypto.cert.X509CertUtils;
@@ -54,7 +54,7 @@ public class SAML20DetailsController   extends BaseAppContorller {
 		ModelAndView modelAndView=new ModelAndView("apps/saml20/appAdd");
 		AppsSAML20Details saml20Details=new AppsSAML20Details();
 		saml20Details.setSecret(ReciprocalUtils.generateKey(""));
-		saml20Details.setProtocol(PROTOCOLS.SAML20);
+		saml20Details.setProtocol(ConstantsProtocols.SAML20);
 		modelAndView.addObject("model",saml20Details);
 		 
 		return modelAndView;
@@ -72,10 +72,10 @@ public class SAML20DetailsController   extends BaseAppContorller {
 		}
 		saml20DetailsService.insert(saml20Details);
 		if (appsService.insertApp(saml20Details)) {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
 			
 		} else {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.error);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.error);
 		}
 		return   WebContext.forward("forwardUpdate/"+saml20Details.getId());
 	}
@@ -107,10 +107,10 @@ public class SAML20DetailsController   extends BaseAppContorller {
 		}
 		saml20DetailsService.update(saml20Details);
 		if (appsService.updateApp(saml20Details)) {
-			 new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
+			 new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
 			
 		} else {
-			 new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+			 new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 		}
 		return   WebContext.forward("forwardUpdate/"+saml20Details.getId());
 	}
@@ -121,10 +121,10 @@ public class SAML20DetailsController   extends BaseAppContorller {
 	public Message delete(@PathVariable("id") String id) {
 		_logger.debug("-delete  application :" + id);
 		if (saml20DetailsService.remove(id)&&appsService.remove(id)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.error);
 		}
 	}
 	

+ 9 - 11
maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/TokenBasedDetailsController.java

@@ -1,9 +1,7 @@
 package org.maxkey.web.apps.contorller;
 
-import java.util.List;
-
-import org.maxkey.constants.OPERATEMESSAGE;
-import org.maxkey.constants.PROTOCOLS;
+import org.maxkey.constants.ConstantsOperateMessage;
+import org.maxkey.constants.ConstantsProtocols;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.dao.service.AppsTokenBasedDetailsService;
 import org.maxkey.domain.apps.AppsTokenBasedDetails;
@@ -34,7 +32,7 @@ public class TokenBasedDetailsController  extends BaseAppContorller {
 	public ModelAndView forwardAdd() {
 		ModelAndView modelAndView=new ModelAndView("apps/tokenbased/appAdd");
 		AppsTokenBasedDetails tokenBasedDetails =new AppsTokenBasedDetails();
-		tokenBasedDetails.setProtocol(PROTOCOLS.TOKENBASED);
+		tokenBasedDetails.setProtocol(ConstantsProtocols.TOKENBASED);
 		tokenBasedDetails.setSecret(ReciprocalUtils.generateKey(ReciprocalUtils.Algorithm.AES));
 		tokenBasedDetails.setAlgorithmKey(tokenBasedDetails.getSecret());
 		modelAndView.addObject("model",tokenBasedDetails);
@@ -51,10 +49,10 @@ public class TokenBasedDetailsController  extends BaseAppContorller {
 		tokenBasedDetails.setAlgorithmKey(tokenBasedDetails.getSecret());
 		
 		if (tokenBasedDetailsService.insert(tokenBasedDetails)&&appsService.insertApp(tokenBasedDetails)) {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
 			
 		} else {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.error);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.error);
 		}
 		return   WebContext.forward("forwardUpdate/"+tokenBasedDetails.getId());
 	}
@@ -83,10 +81,10 @@ public class TokenBasedDetailsController  extends BaseAppContorller {
 		transform(tokenBasedDetails);
 		tokenBasedDetails.setAlgorithmKey(tokenBasedDetails.getSecret());
 		if (tokenBasedDetailsService.update(tokenBasedDetails)&&appsService.updateApp(tokenBasedDetails)) {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
 			
 		} else {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 		}
 		return   WebContext.forward("forwardUpdate/"+tokenBasedDetails.getId());
 	}
@@ -97,10 +95,10 @@ public class TokenBasedDetailsController  extends BaseAppContorller {
 	public Message delete(@PathVariable("id") String id) {
 		_logger.debug("-delete  application :" + id);
 		if (tokenBasedDetailsService.remove(id)&&appsService.remove(id)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.error);
 		}
 	}
 	

+ 4 - 4
maxkey-web-manage/src/main/java/org/maxkey/web/contorller/AccountsController.java

@@ -1,7 +1,7 @@
 package org.maxkey.web.contorller;
 
 import org.apache.mybatis.jpa.persistence.JpaPageResults;
-import org.maxkey.constants.OPERATEMESSAGE;
+import org.maxkey.constants.ConstantsOperateMessage;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.dao.service.AccountsService;
 import org.maxkey.dao.service.AppsService;
@@ -79,7 +79,7 @@ public class AccountsController {
 		_logger.debug("-update  :" + appAccounts);
 		appAccounts.setRelatedPassword(ReciprocalUtils.encode(appAccounts.getRelatedPassword()));
 		accountsService.insert(appAccounts);
-		return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
+		return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
 		
 	}
 	
@@ -107,7 +107,7 @@ public class AccountsController {
 		
 		appAccounts.setRelatedPassword(ReciprocalUtils.encode(appAccounts.getRelatedPassword()));
 		accountsService.update(appAccounts);
-		return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
+		return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
 		
 	}
 	
@@ -123,7 +123,7 @@ public class AccountsController {
 			accountsService.remove(appAccountsds[i]);
 		}
 		
-		return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.success);
+		return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
 		
 		
 	}

+ 5 - 5
maxkey-web-manage/src/main/java/org/maxkey/web/contorller/GroupMemberController.java

@@ -1,7 +1,7 @@
 package org.maxkey.web.contorller;
 
 import org.apache.mybatis.jpa.persistence.JpaPageResults;
-import org.maxkey.constants.OPERATEMESSAGE;
+import org.maxkey.constants.ConstantsOperateMessage;
 import org.maxkey.dao.service.GroupMemberService;
 import org.maxkey.dao.service.GroupsService;
 import org.maxkey.domain.GroupMember;
@@ -115,11 +115,11 @@ public class GroupMemberController {
 				result = groupMemberService.insert(newGroupMember);
 			}
 			if(!result) {
-				return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_ERROR),MessageType.error);
+				return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error);
 			}
 			
 		}
-		return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.info);
+		return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.info);
 	}
 	
 	@RequestMapping(value = {"/delete"})
@@ -138,10 +138,10 @@ public class GroupMemberController {
 				groupMemberService.remove(arrMemberIds[i]);
 			}
 			if(!result) {
-				return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_ERROR),MessageType.error);
+				return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error);
 			}
 			
 		}
-		return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.info);
+		return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.info);
 	}
 }

+ 5 - 5
maxkey-web-manage/src/main/java/org/maxkey/web/contorller/GroupPrivilegesController.java

@@ -1,7 +1,7 @@
 package org.maxkey.web.contorller;
 
 import org.apache.mybatis.jpa.persistence.JpaPageResults;
-import org.maxkey.constants.OPERATEMESSAGE;
+import org.maxkey.constants.ConstantsOperateMessage;
 import org.maxkey.dao.service.GroupPrivilegesService;
 import org.maxkey.domain.GroupPrivileges;
 import org.maxkey.domain.apps.Apps;
@@ -97,11 +97,11 @@ public class GroupPrivilegesController {
 				result = groupPrivilegesService.insert(newGroupApp);
 			}
 			if(!result) {
-				return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_ERROR),MessageType.error);
+				return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error);
 			}
 			
 		}
-		return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.info);
+		return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.info);
 	}
 	
 	@RequestMapping(value = {"/delete"})
@@ -121,11 +121,11 @@ public class GroupPrivilegesController {
 				result = groupPrivilegesService.remove(arrPrivilegesIds[i]);
 			}
 			if(!result) {
-				return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_ERROR),MessageType.error);
+				return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error);
 			}
 			
 		}
-		return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.info);
+		return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.info);
 	}
 	
 	

+ 9 - 9
maxkey-web-manage/src/main/java/org/maxkey/web/contorller/GroupsController.java

@@ -1,7 +1,7 @@
 package org.maxkey.web.contorller;
 
 import org.apache.mybatis.jpa.persistence.JpaPageResults;
-import org.maxkey.constants.OPERATEMESSAGE;
+import org.maxkey.constants.ConstantsOperateMessage;
 import org.maxkey.dao.service.GroupsService;
 import org.maxkey.domain.Groups;
 import org.maxkey.web.WebContext;
@@ -68,10 +68,10 @@ public class GroupsController {
 		_logger.debug("-Add  :" + group);
 		
 		if (groupsService.insert(group)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.error);
 		}
 		
 	}
@@ -86,10 +86,10 @@ public class GroupsController {
 	public Message query(@ModelAttribute("group") Groups group) {
 		_logger.debug("-query  :" + group);
 		if (groupsService.load(group)!=null) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_ERROR),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error);
 		}
 		
 	}
@@ -105,10 +105,10 @@ public class GroupsController {
 		_logger.debug("-update  group :" + group);
 		
 		if (groupsService.update(group)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 		}
 		
 	}
@@ -120,10 +120,10 @@ public class GroupsController {
 		_logger.debug("-delete  group :" + group);
 		
 		if (groupsService.remove(group.getId())) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.error);
 		}
 		
 	}

+ 9 - 9
maxkey-web-manage/src/main/java/org/maxkey/web/contorller/IpAddrFilterController.java

@@ -1,7 +1,7 @@
 package org.maxkey.web.contorller;
 
 import org.apache.mybatis.jpa.persistence.JpaPageResults;
-import org.maxkey.constants.OPERATEMESSAGE;
+import org.maxkey.constants.ConstantsOperateMessage;
 import org.maxkey.dao.service.IpAddrFilterService;
 import org.maxkey.domain.IpAddrFilter;
 import org.maxkey.web.WebContext;
@@ -63,10 +63,10 @@ public class IpAddrFilterController {
 		_logger.debug("-Add  :" + ipAddrFilter);
 		
 		if (ipAddrFilterService.insert(ipAddrFilter)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.error);
 		}
 		
 	}
@@ -81,10 +81,10 @@ public class IpAddrFilterController {
 	public Message query(@ModelAttribute("ipAddrFilter") IpAddrFilter ipAddrFilter) {
 		_logger.debug("-query  :" + ipAddrFilter);
 		if (ipAddrFilterService.load(ipAddrFilter)!=null) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_ERROR),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error);
 		}
 		
 	}
@@ -100,10 +100,10 @@ public class IpAddrFilterController {
 		_logger.debug("-update  ipAddrFilter :" + ipAddrFilter);
 		
 		if (ipAddrFilterService.update(ipAddrFilter)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 		}
 		
 	}
@@ -115,10 +115,10 @@ public class IpAddrFilterController {
 		_logger.debug("-delete  ipAddrFilter :" + ipAddrFilter);
 		
 		if (ipAddrFilterService.delete(ipAddrFilter)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.error);
 		}
 		
 	}

+ 3 - 3
maxkey-web-manage/src/main/java/org/maxkey/web/contorller/PasswordPolicyController.java

@@ -2,7 +2,7 @@ package org.maxkey.web.contorller;
 
 import javax.validation.Valid;
 
-import org.maxkey.constants.OPERATEMESSAGE;
+import org.maxkey.constants.ConstantsOperateMessage;
 import org.maxkey.dao.service.PasswordPolicyService;
 import org.maxkey.domain.PasswordPolicy;
 import org.maxkey.web.WebContext;
@@ -53,9 +53,9 @@ public class PasswordPolicyController {
 				return message;
 			}
 			if(passwordPolicyService.update(passwordPolicy)) {
-				return new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
+				return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
 			} else {
-				return new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+				return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 			}
 		}
 		

+ 11 - 11
maxkey-web-manage/src/main/java/org/maxkey/web/contorller/UserInfoController.java

@@ -9,7 +9,7 @@ import java.util.Map;
 import javax.validation.Valid;
 
 import org.apache.mybatis.jpa.persistence.JpaPageResults;
-import org.maxkey.constants.OPERATEMESSAGE;
+import org.maxkey.constants.ConstantsOperateMessage;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.dao.service.UserInfoService;
 import org.maxkey.domain.UserInfo;
@@ -108,10 +108,10 @@ public class UserInfoController {
 		//userInfo.setNameZHShortSpell(StringUtils.hanYu2Pinyin(userInfo.getDisplayName(), true));
 		//userInfo.setNameZHSpell(StringUtils.hanYu2Pinyin(userInfo.getDisplayName(), false));
 		if( userInfoService.insert(userInfo)) {
-			  new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_SUCCESS),userInfo,MessageType.success,OperateType.add,MessageScope.DB);
+			  new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),userInfo,MessageType.success,OperateType.add,MessageScope.DB);
 		}
 		
-		 new Message(WebContext.getI18nValue(OPERATEMESSAGE.INSERT_ERROR),MessageType.error);
+		 new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error);
 		return   WebContext.forward("forwardUpdate/"+userInfo.getId());
 	}
 	
@@ -167,10 +167,10 @@ public class UserInfoController {
 		convertExtraAttribute(userInfo) ;
 		_logger.info(userInfo.getExtraAttribute());
 		if(userInfoService.update(userInfo)) {
-			new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),userInfo,MessageType.success,OperateType.add,MessageScope.DB);
+			new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),userInfo,MessageType.success,OperateType.add,MessageScope.DB);
 			
 		}
-	    new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+	    new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 		return   WebContext.forward("forwardUpdate/"+userInfo.getId());
 	}
 	
@@ -185,10 +185,10 @@ public class UserInfoController {
 	public Message batchDeleteUsers(@RequestParam("id")String id) {
 		_logger.debug(id);
 		if(userInfoService.batchDelete(StringUtils.string2List(id, ","))) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_ERROR),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_ERROR),MessageType.error);
 		}
 	}
 	
@@ -204,9 +204,9 @@ public class UserInfoController {
 		_logger.debug(id);
 		if(userInfoService.batchDelete(StringUtils.string2List(id, ","))) {
 			//provisioningPrepare.prepare(userInfo, OPERATEACTION.DELETE_ACTION);
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.DELETE_ERROR),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_ERROR),MessageType.error);
 		}
 	}
 	
@@ -237,10 +237,10 @@ public class UserInfoController {
 	public Message changePassword( @ModelAttribute("userInfo")UserInfo userInfo) {
 		_logger.debug(userInfo.getId());
 		if(userInfoService.changePassword(userInfo)) {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
 			
 		} else {
-			return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+			return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 		}
 	}
 	

+ 8 - 8
maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/AppListController.java

@@ -1,8 +1,8 @@
 package org.maxkey.web.contorller;
 
 import java.util.List;
-import org.maxkey.constants.OPERATEMESSAGE;
-import org.maxkey.constants.PROTOCOLS;
+import org.maxkey.constants.ConstantsOperateMessage;
+import org.maxkey.constants.ConstantsProtocols;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.dao.service.AccountsService;
 import org.maxkey.dao.service.AppsService;
@@ -171,10 +171,10 @@ public class AppListController {
 
             userInfoService.updateProtectedApps(userInfo);
         } else {
-            return new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR), MessageType.error);
+            return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR), MessageType.error);
         }
 
-        return new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS), MessageType.success);
+        return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS), MessageType.success);
     }
 
     @RequestMapping(value = { "/forward/appUserConfig/{protocol}/{credential}/{appId}" })
@@ -187,12 +187,12 @@ public class AppListController {
         UserInfo userInfo = WebContext.getUserInfo();
         if (credential == Apps.CREDENTIALS.USER_DEFINED) {
             appUsers = appUsersService.load(new Accounts(userInfo.getId(), appId));
-            if (protocol.equalsIgnoreCase(PROTOCOLS.DESKTOP) || protocol.equalsIgnoreCase(PROTOCOLS.FORMBASED)
-                    || protocol.equalsIgnoreCase(PROTOCOLS.BASIC) || protocol.equalsIgnoreCase(PROTOCOLS.EXTEND_API)) {
+            if (protocol.equalsIgnoreCase(ConstantsProtocols.DESKTOP) || protocol.equalsIgnoreCase(ConstantsProtocols.FORMBASED)
+                    || protocol.equalsIgnoreCase(ConstantsProtocols.BASIC) || protocol.equalsIgnoreCase(ConstantsProtocols.EXTEND_API)) {
 
                 modelAndView.addObject("username", true);
                 modelAndView.addObject("password", true);
-            } else if (protocol.equalsIgnoreCase(PROTOCOLS.SAML20)) {
+            } else if (protocol.equalsIgnoreCase(ConstantsProtocols.SAML20)) {
                 modelAndView.addObject("username", true);
                 modelAndView.addObject("password", false);
             } else {
@@ -253,6 +253,6 @@ public class AppListController {
             }
         }
 
-        return new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS), MessageType.success);
+        return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS), MessageType.success);
     }
 }

+ 3 - 3
maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/ProfileController.java

@@ -1,7 +1,7 @@
 package org.maxkey.web.contorller;
 
 import javax.validation.Valid;
-import org.maxkey.constants.OPERATEMESSAGE;
+import org.maxkey.constants.ConstantsOperateMessage;
 import org.maxkey.dao.service.MyProfileService;
 import org.maxkey.dao.service.UserInfoService;
 import org.maxkey.domain.UserInfo;
@@ -71,12 +71,12 @@ public class ProfileController {
 
         if (myProfileService.updateProfile(userInfo) > 0) {
             new Message(
-                    WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS), 
+                    WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS), 
                     userInfo, MessageType.success,
                     OperateType.add, MessageScope.DB);
 
         } else {
-            new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR), MessageType.error);
+            new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR), MessageType.error);
         }
 
         return WebContext.forward("forwardMyProfile");

+ 2 - 2
maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/RegistrationController.java

@@ -6,7 +6,7 @@ import org.apache.commons.mail.DefaultAuthenticator;
 import org.apache.commons.mail.EmailException;
 import org.apache.commons.mail.HtmlEmail;
 import org.maxkey.config.ApplicationConfig;
-import org.maxkey.constants.STATUS;
+import org.maxkey.constants.ConstantsStatus;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.crypto.password.PasswordReciprocal;
 import org.maxkey.dao.service.RegistrationService;
@@ -136,7 +136,7 @@ public class RegistrationController {
 				
 				userInfo.setWorkPhoneNumber(registration.getWorkPhone());
 				userInfo.setEmail(registration.getWorkEmail());
-				userInfo.setStatus(STATUS.ACTIVE);
+				userInfo.setStatus(ConstantsStatus.ACTIVE);
 				String rawPassword=PasswordReciprocal.getInstance().rawPassword(userInfo.getUsername(), password);
 				userInfo.setDecipherable(ReciprocalUtils.encode(rawPassword));
 				

+ 8 - 8
maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/SafeController.java

@@ -1,6 +1,6 @@
 package org.maxkey.web.contorller;
 
-import org.maxkey.constants.OPERATEMESSAGE;
+import org.maxkey.constants.ConstantsOperateMessage;
 import org.maxkey.crypto.ReciprocalUtils;
 import org.maxkey.crypto.password.PasswordReciprocal;
 import org.maxkey.dao.service.UserInfoService;
@@ -47,9 +47,9 @@ public class SafeController {
 			@RequestParam("confirmPassword") String confirmPassword) {
 		
 			if(changeUserPassword(oldPassword,newPassword,confirmPassword)) {
-				return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
+				return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
 			}else {
-				return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+				return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 			}	
 	}
 
@@ -66,7 +66,7 @@ public class SafeController {
 			}
 				
 		
-			new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+			new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 		 
 			return modelAndView;
 	}
@@ -84,7 +84,7 @@ public class SafeController {
 			//modelAndView.setViewName("index");
 		}
 		
-		  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+		  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 		  return modelAndView;
 	}
 	
@@ -130,11 +130,11 @@ public class SafeController {
 				userInfo.setAppLoginPassword(ReciprocalUtils.encode(newPassword));
 				boolean change= userInfoService.changeAppLoginPassword(userInfo);
 				_logger.debug(""+change);
-				return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.prompt);
+				return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.prompt);
 			}
 		}
 		
-		return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_ERROR),MessageType.error);
+		return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_ERROR),MessageType.error);
 		
 	}
 	
@@ -164,7 +164,7 @@ public class SafeController {
 		userInfo.setEmail(email);
 		userInfoService.changeEmail(userInfo);
 		
-		return  new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success);
+		return  new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
 		
 	}
 	

+ 5 - 5
maxkey-web-maxkey/src/main/java/org/maxkey/web/endpoint/IndexEndpoint.java

@@ -1,7 +1,7 @@
 package org.maxkey.web.endpoint;
 
 import org.maxkey.config.ApplicationConfig;
-import org.maxkey.constants.PASSWORDSETTYPE;
+import org.maxkey.constants.ConstantsPasswordSetType;
 import org.maxkey.domain.UserInfo;
 import org.maxkey.web.WebConstants;
 import org.maxkey.web.WebContext;
@@ -31,7 +31,7 @@ public class IndexEndpoint {
 		_logger.debug("IndexEndpoint /forwardindex.");
 		ModelAndView modelAndView=new ModelAndView();
 		Integer passwordSetType=(Integer)WebContext.getSession().getAttribute(WebConstants.CURRENT_LOGIN_USER_PASSWORD_SET_TYPE);
-		if(passwordSetType==null || passwordSetType==PASSWORDSETTYPE.PASSWORD_NORMAL){
+		if(passwordSetType==null || passwordSetType==ConstantsPasswordSetType.PASSWORD_NORMAL){
 			if(applicationConfig.getLoginConfig().getDefaultUri()!=null&&
 					!applicationConfig.getLoginConfig().getDefaultUri().equals("")){
 				if(applicationConfig.getLoginConfig().getDefaultUri().startsWith("http")){
@@ -45,11 +45,11 @@ public class IndexEndpoint {
 		
 		UserInfo userInfo=WebContext.getUserInfo();
 		modelAndView.addObject("model", userInfo);
-		if(passwordSetType==PASSWORDSETTYPE.PASSWORD_EXPIRED){
+		if(passwordSetType==ConstantsPasswordSetType.PASSWORD_EXPIRED){
 			modelAndView.setViewName("passwordExpired");
 			return  modelAndView;
-		}else if(passwordSetType==PASSWORDSETTYPE.INITIAL_PASSWORD||
-				 passwordSetType==PASSWORDSETTYPE.MANAGER_CHANGED_PASSWORD){
+		}else if(passwordSetType==ConstantsPasswordSetType.INITIAL_PASSWORD||
+				 passwordSetType==ConstantsPasswordSetType.MANAGER_CHANGED_PASSWORD){
 			modelAndView.setViewName("passwordInitial");
 			return  modelAndView;
 		}