소스 검색

separate common

MaxKey 4 년 전
부모
커밋
9770acf991
37개의 변경된 파일195개의 추가작업 그리고 86개의 파일을 삭제
  1. 1 0
      maxkey-authentications/maxkey-authentication-core/build.gradle
  2. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/AbstractAuthenticationProvider.java
  3. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/LoginCredential.java
  4. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/RealmAuthenticationProvider.java
  5. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/SavedRequestAwareAuthenticationSuccessHandler.java
  6. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/SigninPrincipal.java
  7. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/online/InMemoryOnlineTicketServices.java
  8. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/online/OnlineTicket.java
  9. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/online/OnlineTicketServices.java
  10. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/online/RedisOnlineTicketServices.java
  11. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/AbstractAuthenticationRealm.java
  12. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/IAuthenticationServer.java
  13. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/jdbc/DefaultJdbcAuthenticationRealm.java
  14. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/jdbc/JdbcAuthenticationRealm.java
  15. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/support/jwt/JwtLoginService.java
  16. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/support/rememberme/AbstractRemeberMeService.java
  17. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/support/rememberme/InMemoryRemeberMeService.java
  18. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/support/rememberme/JdbcRemeberMeService.java
  19. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/support/rememberme/RedisRemeberMeService.java
  20. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/support/rememberme/RemeberMe.java
  21. 180 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/autoconfigure/AuthenticationAutoConfiguration.java
  22. 0 0
      maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/autoconfigure/JwtAuthnAutoConfiguration.java
  23. 1 0
      maxkey-authentications/maxkey-authentication-social/build.gradle
  24. 0 1
      maxkey-core/build.gradle
  25. 1 82
      maxkey-core/src/main/java/org/maxkey/autoconfigure/ApplicationAutoConfiguration.java
  26. 1 2
      maxkey-protocols/maxkey-protocol-authorize/build.gradle
  27. 1 0
      maxkey-protocols/maxkey-protocol-cas/build.gradle
  28. 1 0
      maxkey-protocols/maxkey-protocol-desktop/build.gradle
  29. 1 0
      maxkey-protocols/maxkey-protocol-extendapi/build.gradle
  30. 1 0
      maxkey-protocols/maxkey-protocol-formbased/build.gradle
  31. 1 0
      maxkey-protocols/maxkey-protocol-jwt/build.gradle
  32. 1 1
      maxkey-protocols/maxkey-protocol-oauth-2.0/build.gradle
  33. 1 0
      maxkey-protocols/maxkey-protocol-saml-2.0/build.gradle
  34. 1 0
      maxkey-protocols/maxkey-protocol-tokenbased/build.gradle
  35. 1 0
      maxkey-web-manage/build.gradle
  36. 1 0
      maxkey-web-manage/src/main/resources/META-INF/spring.factories
  37. 1 0
      maxkey-web-maxkey/src/main/resources/META-INF/spring.factories

+ 1 - 0
maxkey-authentications/maxkey-authentication-core/build.gradle

@@ -11,5 +11,6 @@ dependencies {
 	compile project(":maxkey-persistence")
    	compile project(":maxkey-protocols:maxkey-protocol-oauth-2.0")
    	compile project(":maxkey-protocols:maxkey-protocol-saml-2.0")
+   	compile project(":maxkey-authentications:maxkey-authentication-otp")
    
 }

+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/AbstractAuthenticationProvider.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/AbstractAuthenticationProvider.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/LoginCredential.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/LoginCredential.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/RealmAuthenticationProvider.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/RealmAuthenticationProvider.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/SavedRequestAwareAuthenticationSuccessHandler.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/SavedRequestAwareAuthenticationSuccessHandler.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/SigninPrincipal.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/SigninPrincipal.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/online/InMemoryOnlineTicketServices.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/online/InMemoryOnlineTicketServices.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/online/OnlineTicket.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/online/OnlineTicket.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/online/OnlineTicketServices.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/online/OnlineTicketServices.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/online/RedisOnlineTicketServices.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/online/RedisOnlineTicketServices.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/realm/AbstractAuthenticationRealm.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/AbstractAuthenticationRealm.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/realm/IAuthenticationServer.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/IAuthenticationServer.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/realm/jdbc/DefaultJdbcAuthenticationRealm.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/jdbc/DefaultJdbcAuthenticationRealm.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/realm/jdbc/JdbcAuthenticationRealm.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/realm/jdbc/JdbcAuthenticationRealm.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/support/jwt/JwtLoginService.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/support/jwt/JwtLoginService.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/support/rememberme/AbstractRemeberMeService.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/support/rememberme/AbstractRemeberMeService.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/support/rememberme/InMemoryRemeberMeService.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/support/rememberme/InMemoryRemeberMeService.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/support/rememberme/JdbcRemeberMeService.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/support/rememberme/JdbcRemeberMeService.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/support/rememberme/RedisRemeberMeService.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/support/rememberme/RedisRemeberMeService.java


+ 0 - 0
maxkey-core/src/main/java/org/maxkey/authn/support/rememberme/RemeberMe.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/support/rememberme/RemeberMe.java


+ 180 - 0
maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/autoconfigure/AuthenticationAutoConfiguration.java

@@ -0,0 +1,180 @@
+/*
+ * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+
+package org.maxkey.autoconfigure;
+
+import java.util.HashMap;
+import java.util.Map;
+import javax.sql.DataSource;
+import org.maxkey.authn.AbstractAuthenticationProvider;
+import org.maxkey.authn.RealmAuthenticationProvider;
+import org.maxkey.authn.SavedRequestAwareAuthenticationSuccessHandler;
+import org.maxkey.authn.online.InMemoryOnlineTicketServices;
+import org.maxkey.authn.online.OnlineTicketServices;
+import org.maxkey.authn.online.RedisOnlineTicketServices;
+import org.maxkey.authn.support.rememberme.AbstractRemeberMeService;
+import org.maxkey.authn.support.rememberme.InMemoryRemeberMeService;
+import org.maxkey.authn.support.rememberme.RedisRemeberMeService;
+import org.maxkey.constants.ConstantsPersistence;
+import org.maxkey.constants.ConstantsProperties;
+import org.maxkey.crypto.password.LdapShaPasswordEncoder;
+import org.maxkey.crypto.password.Md4PasswordEncoder;
+import org.maxkey.crypto.password.NoOpPasswordEncoder;
+import org.maxkey.crypto.password.MessageDigestPasswordEncoder;
+import org.maxkey.crypto.password.SM3PasswordEncoder;
+import org.maxkey.crypto.password.StandardPasswordEncoder;
+import org.maxkey.persistence.db.PasswordPolicyValidator;
+import org.maxkey.persistence.redis.RedisConnectionFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.MessageSource;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.datasource.DataSourceTransactionManager;
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import org.springframework.security.crypto.password.DelegatingPasswordEncoder;
+
+import org.springframework.security.crypto.password.PasswordEncoder;
+import org.springframework.security.crypto.password.Pbkdf2PasswordEncoder;
+import org.springframework.security.crypto.scrypt.SCryptPasswordEncoder;
+import org.maxkey.persistence.db.LoginService;
+import org.maxkey.persistence.db.LoginHistoryService;
+
+
+@Configuration
+@PropertySource(ConstantsProperties.applicationPropertySource)
+@PropertySource(ConstantsProperties.maxKeyPropertySource)
+public class AuthenticationAutoConfiguration  implements InitializingBean {
+    private static final  Logger _logger = 
+            LoggerFactory.getLogger(AuthenticationAutoConfiguration.class);
+    
+    
+    @Bean(name = "savedRequestSuccessHandler")
+    public SavedRequestAwareAuthenticationSuccessHandler 
+            savedRequestAwareAuthenticationSuccessHandler() {
+        return new SavedRequestAwareAuthenticationSuccessHandler();
+    }
+    
+    @Bean(name = "authenticationProvider")
+    public AbstractAuthenticationProvider authenticationProvider() {
+        return new RealmAuthenticationProvider();
+    }
+    
+    @Bean(name = "transactionManager")
+    public DataSourceTransactionManager transactionManager(DataSource dataSource) {
+        return new DataSourceTransactionManager(dataSource);
+    }
+    
+    @Bean(name = "passwordPolicyValidator")
+    public PasswordPolicyValidator passwordPolicyValidator(JdbcTemplate jdbcTemplate,MessageSource messageSource) {
+        return new PasswordPolicyValidator(jdbcTemplate,messageSource);
+    }
+    
+    @Bean(name = "loginService")
+    public LoginService LoginService(JdbcTemplate jdbcTemplate) {
+        return new LoginService(jdbcTemplate);
+    }
+    @Bean(name = "loginHistoryService")
+    public LoginHistoryService loginHistoryService(JdbcTemplate jdbcTemplate) {
+        return new LoginHistoryService(jdbcTemplate);
+    }
+    
+    
+    /**
+     * Authentication Password Encoder .
+     * @return
+     */
+    @Bean(name = "passwordEncoder")
+    public PasswordEncoder passwordEncoder() {
+        String idForEncode = "bcrypt";
+        Map<String ,PasswordEncoder > encoders = new HashMap<String ,PasswordEncoder>();
+        encoders.put(idForEncode, new BCryptPasswordEncoder());
+        encoders.put("plain", NoOpPasswordEncoder.getInstance());
+        encoders.put("pbkdf2", new Pbkdf2PasswordEncoder());
+        encoders.put("scrypt", new SCryptPasswordEncoder());
+        //md
+        encoders.put("md4", new Md4PasswordEncoder());
+        encoders.put("md5", new MessageDigestPasswordEncoder("MD5"));
+        //sha
+        encoders.put("sha1", new StandardPasswordEncoder("SHA-1",""));
+        encoders.put("sha256", new StandardPasswordEncoder());
+        encoders.put("sha384", new StandardPasswordEncoder("SHA-384",""));
+        encoders.put("sha512", new StandardPasswordEncoder("SHA-512",""));
+        
+        encoders.put("sm3", new SM3PasswordEncoder());
+        
+        encoders.put("ldap", new LdapShaPasswordEncoder());
+        
+        //idForEncode is default for encoder
+        PasswordEncoder passwordEncoder =
+            new DelegatingPasswordEncoder(idForEncode, encoders);
+        
+        return passwordEncoder;
+    }
+    
+    /**
+     * remeberMeService .
+     * @return
+     */
+    @Bean(name = "remeberMeService")
+    public AbstractRemeberMeService remeberMeService(
+            @Value("${config.server.persistence}") int persistence,
+            @Value("${config.login.remeberme.validity}") int validity,
+            JdbcTemplate jdbcTemplate,
+            RedisConnectionFactory redisConnFactory) {
+        AbstractRemeberMeService remeberMeService = null;
+        if (persistence == ConstantsPersistence.INMEMORY) {
+            remeberMeService = new InMemoryRemeberMeService();
+            _logger.debug("InMemoryRemeberMeService");
+        } else if (persistence == ConstantsPersistence.JDBC) {
+            //remeberMeService = new JdbcRemeberMeService(jdbcTemplate);
+            _logger.debug("JdbcRemeberMeService not support "); 
+        } else if (persistence == ConstantsPersistence.REDIS) {
+            remeberMeService = new RedisRemeberMeService(redisConnFactory);
+            _logger.debug("RedisRemeberMeService");
+        }
+        return remeberMeService;
+    }
+    
+    @Bean(name = "onlineTicketServices")
+    public OnlineTicketServices onlineTicketServices(
+            @Value("${config.server.persistence}") int persistence,
+            JdbcTemplate jdbcTemplate,
+            RedisConnectionFactory redisConnFactory) {
+        OnlineTicketServices onlineTicketServices = null;
+        if (persistence == ConstantsPersistence.INMEMORY) {
+            onlineTicketServices = new InMemoryOnlineTicketServices();
+            _logger.debug("InMemoryOnlineTicketServices");
+        } else if (persistence == ConstantsPersistence.JDBC) {
+            _logger.debug("OnlineTicketServices not support "); 
+        } else if (persistence == ConstantsPersistence.REDIS) {
+            onlineTicketServices = new RedisOnlineTicketServices(redisConnFactory);
+            _logger.debug("RedisOnlineTicketServices");
+        }
+        return onlineTicketServices;
+    }
+    
+    @Override
+    public void afterPropertiesSet() throws Exception {
+        // TODO Auto-generated method stub
+        
+    }
+}

+ 0 - 0
maxkey-core/src/main/java/org/maxkey/autoconfigure/JwtAuthnAutoConfiguration.java → maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/autoconfigure/JwtAuthnAutoConfiguration.java


+ 1 - 0
maxkey-authentications/maxkey-authentication-social/build.gradle

@@ -9,5 +9,6 @@ dependencies {
 	compile project(":maxkey-common")
 	compile project(":maxkey-core")
 	compile project(":maxkey-persistence")
+	compile project(":maxkey-authentications:maxkey-authentication-core")
    
 }

+ 0 - 1
maxkey-core/build.gradle

@@ -2,7 +2,6 @@ description = "maxkey-core"
 
 dependencies {
 	compile project(":maxkey-common")
-	compile project(":maxkey-authentications:maxkey-authentication-otp")
 	
 	//local jars
 	compile fileTree(dir: '../maxkey-lib/', include: '*/*.jar')

+ 1 - 82
maxkey-core/src/main/java/org/maxkey/autoconfigure/ApplicationAutoConfiguration.java

@@ -23,17 +23,6 @@ import java.util.HashMap;
 import java.util.Map;
 
 import javax.sql.DataSource;
-
-import org.maxkey.authn.AbstractAuthenticationProvider;
-import org.maxkey.authn.RealmAuthenticationProvider;
-import org.maxkey.authn.SavedRequestAwareAuthenticationSuccessHandler;
-import org.maxkey.authn.online.InMemoryOnlineTicketServices;
-import org.maxkey.authn.online.OnlineTicketServices;
-import org.maxkey.authn.online.RedisOnlineTicketServices;
-import org.maxkey.authn.support.rememberme.AbstractRemeberMeService;
-import org.maxkey.authn.support.rememberme.InMemoryRemeberMeService;
-import org.maxkey.authn.support.rememberme.RedisRemeberMeService;
-import org.maxkey.constants.ConstantsPersistence;
 import org.maxkey.constants.ConstantsProperties;
 import org.maxkey.crypto.keystore.KeyStoreLoader;
 import org.maxkey.crypto.password.LdapShaPasswordEncoder;
@@ -43,14 +32,11 @@ import org.maxkey.crypto.password.MessageDigestPasswordEncoder;
 import org.maxkey.crypto.password.PasswordReciprocal;
 import org.maxkey.crypto.password.SM3PasswordEncoder;
 import org.maxkey.crypto.password.StandardPasswordEncoder;
-import org.maxkey.persistence.db.PasswordPolicyValidator;
-import org.maxkey.persistence.redis.RedisConnectionFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.InitializingBean;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.MessageSource;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Primary;
@@ -66,8 +52,6 @@ import org.springframework.security.crypto.password.DelegatingPasswordEncoder;
 import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.security.crypto.password.Pbkdf2PasswordEncoder;
 import org.springframework.security.crypto.scrypt.SCryptPasswordEncoder;
-import org.maxkey.persistence.db.LoginService;
-import org.maxkey.persistence.db.LoginHistoryService;
 
 
 @Configuration
@@ -115,16 +99,6 @@ public class ApplicationAutoConfiguration  implements InitializingBean {
         return new PasswordReciprocal();
     }
     
-    @Bean(name = "savedRequestSuccessHandler")
-    public SavedRequestAwareAuthenticationSuccessHandler 
-            savedRequestAwareAuthenticationSuccessHandler() {
-        return new SavedRequestAwareAuthenticationSuccessHandler();
-    }
-    
-    @Bean(name = "authenticationProvider")
-    public AbstractAuthenticationProvider authenticationProvider() {
-        return new RealmAuthenticationProvider();
-    }
     
     @Bean(name = "jdbcTemplate")
     public JdbcTemplate jdbcTemplate(DataSource dataSource) {
@@ -136,20 +110,6 @@ public class ApplicationAutoConfiguration  implements InitializingBean {
         return new DataSourceTransactionManager(dataSource);
     }
     
-    @Bean(name = "passwordPolicyValidator")
-    public PasswordPolicyValidator passwordPolicyValidator(JdbcTemplate jdbcTemplate,MessageSource messageSource) {
-        return new PasswordPolicyValidator(jdbcTemplate,messageSource);
-    }
-    
-    @Bean(name = "loginService")
-    public LoginService LoginService(JdbcTemplate jdbcTemplate) {
-        return new LoginService(jdbcTemplate);
-    }
-    @Bean(name = "loginHistoryService")
-    public LoginHistoryService loginHistoryService(JdbcTemplate jdbcTemplate) {
-        return new LoginHistoryService(jdbcTemplate);
-    }
-    
     
     /**
      * Authentication Password Encoder .
@@ -182,48 +142,7 @@ public class ApplicationAutoConfiguration  implements InitializingBean {
         
         return passwordEncoder;
     }
-    
-    /**
-     * remeberMeService .
-     * @return
-     */
-    @Bean(name = "remeberMeService")
-    public AbstractRemeberMeService remeberMeService(
-            @Value("${config.server.persistence}") int persistence,
-            @Value("${config.login.remeberme.validity}") int validity,
-            JdbcTemplate jdbcTemplate,
-            RedisConnectionFactory redisConnFactory) {
-        AbstractRemeberMeService remeberMeService = null;
-        if (persistence == ConstantsPersistence.INMEMORY) {
-            remeberMeService = new InMemoryRemeberMeService();
-            _logger.debug("InMemoryRemeberMeService");
-        } else if (persistence == ConstantsPersistence.JDBC) {
-            //remeberMeService = new JdbcRemeberMeService(jdbcTemplate);
-            _logger.debug("JdbcRemeberMeService not support "); 
-        } else if (persistence == ConstantsPersistence.REDIS) {
-            remeberMeService = new RedisRemeberMeService(redisConnFactory);
-            _logger.debug("RedisRemeberMeService");
-        }
-        return remeberMeService;
-    }
-    
-    @Bean(name = "onlineTicketServices")
-    public OnlineTicketServices onlineTicketServices(
-            @Value("${config.server.persistence}") int persistence,
-            JdbcTemplate jdbcTemplate,
-            RedisConnectionFactory redisConnFactory) {
-        OnlineTicketServices onlineTicketServices = null;
-        if (persistence == ConstantsPersistence.INMEMORY) {
-            onlineTicketServices = new InMemoryOnlineTicketServices();
-            _logger.debug("InMemoryOnlineTicketServices");
-        } else if (persistence == ConstantsPersistence.JDBC) {
-            _logger.debug("OnlineTicketServices not support "); 
-        } else if (persistence == ConstantsPersistence.REDIS) {
-            onlineTicketServices = new RedisOnlineTicketServices(redisConnFactory);
-            _logger.debug("RedisOnlineTicketServices");
-        }
-        return onlineTicketServices;
-    }
+
     
     /**
      * keyStoreLoader .

+ 1 - 2
maxkey-protocols/maxkey-protocol-authorize/build.gradle

@@ -9,7 +9,6 @@ dependencies {
 	compile project(":maxkey-common")
 	compile project(":maxkey-core")
 	compile project(":maxkey-persistence")
-   	//compileOnly project(":maxkey-protocols:maxkey-protocol-oauth-2.0")
-   	//compileOnly project(":maxkey-protocols:maxkey-protocol-saml-2.0")
+   	compile project(":maxkey-authentications:maxkey-authentication-core")
    
 }

+ 1 - 0
maxkey-protocols/maxkey-protocol-cas/build.gradle

@@ -17,5 +17,6 @@ dependencies {
 	compile project(":maxkey-core")
 	compile project(":maxkey-persistence")
    	compile project(":maxkey-protocols:maxkey-protocol-authorize")
+   	compile project(":maxkey-authentications:maxkey-authentication-core")
    
 }

+ 1 - 0
maxkey-protocols/maxkey-protocol-desktop/build.gradle

@@ -10,5 +10,6 @@ dependencies {
 	compile project(":maxkey-core")
 	compile project(":maxkey-persistence")
    	compile project(":maxkey-protocols:maxkey-protocol-authorize")
+   	compile project(":maxkey-authentications:maxkey-authentication-core")
    
 }

+ 1 - 0
maxkey-protocols/maxkey-protocol-extendapi/build.gradle

@@ -10,4 +10,5 @@ dependencies {
 	compile project(":maxkey-core")
 	compile project(":maxkey-persistence")
     compile project(":maxkey-protocols:maxkey-protocol-authorize")
+    compile project(":maxkey-authentications:maxkey-authentication-core")
 }

+ 1 - 0
maxkey-protocols/maxkey-protocol-formbased/build.gradle

@@ -10,5 +10,6 @@ dependencies {
 	compile project(":maxkey-core")
 	compile project(":maxkey-persistence")
    	compile project(":maxkey-protocols:maxkey-protocol-authorize")
+   	compile project(":maxkey-authentications:maxkey-authentication-core")
    
 }

+ 1 - 0
maxkey-protocols/maxkey-protocol-jwt/build.gradle

@@ -10,5 +10,6 @@ dependencies {
 	compile project(":maxkey-core")
 	compile project(":maxkey-persistence")
    	compile project(":maxkey-protocols:maxkey-protocol-authorize")
+   	compile project(":maxkey-authentications:maxkey-authentication-core")
    
 }

+ 1 - 1
maxkey-protocols/maxkey-protocol-oauth-2.0/build.gradle

@@ -8,5 +8,5 @@ dependencies {
     compile project(":maxkey-core")
     compile project(":maxkey-persistence")
     compile project(":maxkey-protocols:maxkey-protocol-authorize")
-   
+    compile project(":maxkey-authentications:maxkey-authentication-core")
 }

+ 1 - 0
maxkey-protocols/maxkey-protocol-saml-2.0/build.gradle

@@ -7,4 +7,5 @@ dependencies {
 	compile project(":maxkey-common")
     compile project(":maxkey-core")
     compile project(":maxkey-persistence")
+    compile project(":maxkey-authentications:maxkey-authentication-core")
 }

+ 1 - 0
maxkey-protocols/maxkey-protocol-tokenbased/build.gradle

@@ -10,5 +10,6 @@ dependencies {
 	compile project(":maxkey-core")
 	compile project(":maxkey-persistence")
    	compile project(":maxkey-protocols:maxkey-protocol-authorize")
+   	compile project(":maxkey-authentications:maxkey-authentication-core")
    
 }

+ 1 - 0
maxkey-web-manage/build.gradle

@@ -62,6 +62,7 @@ jib {
 dependencies {
 	compile project(":maxkey-common")
 	compile project(":maxkey-core")
+	compile project(":maxkey-authentications:maxkey-authentication-core")
 	compile project(":maxkey-authentications:maxkey-authentication-captcha")
 	compile project(":maxkey-authentications:maxkey-authentication-otp")
    	compile project(":maxkey-persistence")

+ 1 - 0
maxkey-web-manage/src/main/resources/META-INF/spring.factories

@@ -5,5 +5,6 @@ org.maxkey.autoconfigure.KaptchaAutoConfiguration,\
 org.maxkey.autoconfigure.MvcAutoConfiguration,\
 org.maxkey.autoconfigure.JwtAuthnAutoConfiguration,\
 org.maxkey.autoconfigure.RedisAutoConfiguration,\
+org.maxkey.autoconfigure.AuthenticationAutoConfiguration,\
 org.maxkey.MaxKeyMgtConfig,\
 org.maxkey.MaxKeyMgtMvcConfig

+ 1 - 0
maxkey-web-maxkey/src/main/resources/META-INF/spring.factories

@@ -4,6 +4,7 @@ org.maxkey.autoconfigure.ApplicationAutoConfiguration,\
 org.maxkey.autoconfigure.MvcAutoConfiguration,\
 org.maxkey.autoconfigure.KaptchaAutoConfiguration,\
 org.maxkey.autoconfigure.RedisAutoConfiguration,\
+org.maxkey.autoconfigure.AuthenticationAutoConfiguration,\
 org.maxkey.autoconfigure.CasAutoConfiguration,\
 org.maxkey.autoconfigure.Oauth20AutoConfiguration,\
 org.maxkey.autoconfigure.Saml20AutoConfiguration,\