MaxKey 3 年之前
父节点
当前提交
9d81e0cbbb
共有 16 个文件被更改,包括 350 次插入267 次删除
  1. 10 0
      maxkey-authentications/maxkey-authentication-otp/src/main/java/org/maxkey/password/onetimepwd/AbstractOtpAuthn.java
  2. 3 2
      maxkey-authentications/maxkey-authentication-otp/src/main/java/org/maxkey/password/onetimepwd/impl/MailOtpAuthn.java
  3. 6 6
      maxkey-authentications/maxkey-authentication-social/src/main/java/org/maxkey/authn/support/socialsignon/service/JdbcSocialsAssociateService.java
  4. 1 1
      maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/HistoryLoginAppsMapper.xml
  5. 26 1
      maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/MaxKeyConfig.java
  6. 28 11
      maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/ForgotPasswordContorller.java
  7. 2 1
      maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/historys/contorller/HistoryLoginAppsController.java
  8. 9 11
      maxkey-webs/maxkey-web-maxkey/src/main/resources/application-http.properties
  9. 11 12
      maxkey-webs/maxkey-web-maxkey/src/main/resources/application-https.properties
  10. 5 0
      maxkey-webs/maxkey-web-maxkey/src/main/resources/messages/email/forgotpassword.html
  11. 4 0
      maxkey-webs/maxkey-web-maxkey/src/main/resources/messages/message.properties
  12. 4 0
      maxkey-webs/maxkey-web-maxkey/src/main/resources/messages/message_en.properties
  13. 4 0
      maxkey-webs/maxkey-web-maxkey/src/main/resources/messages/message_zh_CN.properties
  14. 2 1
      maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/forgotpassword/pwdreseted.ftl
  15. 233 0
      maxkey-webs/maxkey-web-mgt/src/main/resources/application-http.properties
  16. 2 221
      maxkey-webs/maxkey-web-mgt/src/main/resources/application.properties

+ 10 - 0
maxkey-authentications/maxkey-authentication-otp/src/main/java/org/maxkey/password/onetimepwd/AbstractOtpAuthn.java

@@ -42,6 +42,8 @@ public abstract class AbstractOtpAuthn {
 
 
     protected String crypto = "HmacSHA1";
     protected String crypto = "HmacSHA1";
 
 
+    protected String defaultEncoding ="utf-8";
+    
     StringGenerator stringGenerator;
     StringGenerator stringGenerator;
     
     
     protected String otpType = OtpTypes.TIMEBASED_OTP;
     protected String otpType = OtpTypes.TIMEBASED_OTP;
@@ -149,5 +151,13 @@ public abstract class AbstractOtpAuthn {
     public void initPropertys() {
     public void initPropertys() {
         
         
     }
     }
+
+    public String getDefaultEncoding() {
+        return defaultEncoding;
+    }
+
+    public void setDefaultEncoding(String defaultEncoding) {
+        this.defaultEncoding = defaultEncoding;
+    }
  
  
 }
 }

+ 3 - 2
maxkey-authentications/maxkey-authentication-otp/src/main/java/org/maxkey/password/onetimepwd/impl/MailOtpAuthn.java

@@ -20,7 +20,7 @@ package org.maxkey.password.onetimepwd.impl;
 import java.text.MessageFormat;
 import java.text.MessageFormat;
 import org.apache.commons.mail.DefaultAuthenticator;
 import org.apache.commons.mail.DefaultAuthenticator;
 import org.apache.commons.mail.Email;
 import org.apache.commons.mail.Email;
-import org.apache.commons.mail.SimpleEmail;
+import org.apache.commons.mail.HtmlEmail;
 import org.maxkey.configuration.EmailConfig;
 import org.maxkey.configuration.EmailConfig;
 import org.maxkey.entity.UserInfo;
 import org.maxkey.entity.UserInfo;
 import org.maxkey.password.onetimepwd.AbstractOtpAuthn;
 import org.maxkey.password.onetimepwd.AbstractOtpAuthn;
@@ -45,7 +45,8 @@ public class MailOtpAuthn extends AbstractOtpAuthn {
     public boolean produce(UserInfo userInfo) {
     public boolean produce(UserInfo userInfo) {
         try {
         try {
             String token = this.genToken(userInfo);
             String token = this.genToken(userInfo);
-            Email email = new SimpleEmail();
+            Email email = new HtmlEmail();
+            email.setCharset(this.defaultEncoding);
             email.setHostName(emailConfig.getSmtpHost());
             email.setHostName(emailConfig.getSmtpHost());
             email.setSmtpPort(emailConfig.getPort());
             email.setSmtpPort(emailConfig.getPort());
             email.setSSLOnConnect(emailConfig.isSsl());
             email.setSSLOnConnect(emailConfig.isSsl());

+ 6 - 6
maxkey-authentications/maxkey-authentication-social/src/main/java/org/maxkey/authn/support/socialsignon/service/JdbcSocialsAssociateService.java

@@ -31,17 +31,17 @@ import org.springframework.jdbc.core.RowMapper;
 public class JdbcSocialsAssociateService   implements SocialsAssociateService{
 public class JdbcSocialsAssociateService   implements SocialsAssociateService{
 	private static final Logger _logger = LoggerFactory.getLogger(JdbcSocialsAssociateService.class);
 	private static final Logger _logger = LoggerFactory.getLogger(JdbcSocialsAssociateService.class);
 	
 	
-	private static final String DEFAULT_DEFAULT_INSERT_STATEMENT = "INSERT INTO  MXK_SOCIALS_ASSOCIATE(ID, UID , USERNAME , PROVIDER , SOCIALUID , ACCESSTOKEN , SOCIALUSERINFO , EXATTRIBUTE )VALUES( ? , ? , ? , ? , ?, ? , ? , ?)";
+	private static final String DEFAULT_DEFAULT_INSERT_STATEMENT = "insert into  mxk_socials_associate(id, uid , username , provider , socialuid , accesstoken , socialuserinfo , exattribute )values( ? , ? , ? , ? , ?, ? , ? , ?)";
 	
 	
-	private static final String DEFAULT_DEFAULT_INSERT_STATEMENT_ORACLE = "INSERT INTO  MXK_SOCIALS_ASSOCIATE(ID, \"UID\" , USERNAME , PROVIDER , SOCIALUID , ACCESSTOKEN , SOCIALUSERINFO , EXATTRIBUTE )VALUES( ? , ? , ? , ? , ?, ? , ? , ?)";
+	private static final String DEFAULT_DEFAULT_INSERT_STATEMENT_ORACLE = "insert into  mxk_socials_associate(id, uid , username , provider , socialuid , accesstoken , socialuserinfo , exattribute )values( ? , ? , ? , ? , ?, ? , ? , ?)";
 	
 	
-	private static final String DEFAULT_DEFAULT_SIGNON_SELECT_STATEMENT = "SELECT ID, \"UID\" , USERNAME , PROVIDER , SOCIALUID , ACCESSTOKEN , SOCIALUSERINFO , EXATTRIBUTE , CREATEDDATE , UPDATEDDATE  FROM MXK_SOCIALS_ASSOCIATE WHERE PROVIDER = ?  AND SOCIALUID = ?";
+	private static final String DEFAULT_DEFAULT_SIGNON_SELECT_STATEMENT = "select id, uid , username , provider , socialuid , accesstoken , socialuserinfo , exattribute , createddate , updateddate  from mxk_socials_associate where provider = ?  and socialuid = ?";
 	
 	
-	private static final String DEFAULT_DEFAULT_BIND_SELECT_STATEMENT = "SELECT ID, \"UID\" , USERNAME , PROVIDER , SOCIALUID , ACCESSTOKEN , SOCIALUSERINFO , EXATTRIBUTE , CREATEDDATE , UPDATEDDATE  FROM MXK_SOCIALS_ASSOCIATE WHERE \"UID\" = ?" ;
+	private static final String DEFAULT_DEFAULT_BIND_SELECT_STATEMENT = "select id, uid , username , provider , socialuid , accesstoken , socialuserinfo , exattribute , createddate , updateddate  from mxk_socials_associate where uid = ?" ;
 	
 	
-	private static final String DEFAULT_DEFAULT_DELETE_STATEMENT = "DELETE FROM  MXK_SOCIALS_ASSOCIATE WHERE  \"UID\" = ? AND PROVIDER = ?";
+	private static final String DEFAULT_DEFAULT_DELETE_STATEMENT = "delete from  mxk_socials_associate where  uid = ? and provider = ?";
 	
 	
-	private static final String DEFAULT_DEFAULT_UPDATE_STATEMENT= "UPDATE MXK_SOCIALS_ASSOCIATE  SET ACCESSTOKEN  = ? , SOCIALUSERINFO = ? , EXATTRIBUTE = ? ,UPDATEDDATE = ?  WHERE ID = ?";
+	private static final String DEFAULT_DEFAULT_UPDATE_STATEMENT= "update mxk_socials_associate  set accesstoken  = ? , socialuserinfo = ? , exattribute = ? ,updateddate = ?  where id = ?";
 
 
 	private final JdbcTemplate jdbcTemplate;
 	private final JdbcTemplate jdbcTemplate;
 	
 	

+ 1 - 1
maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/HistoryLoginAppsMapper.xml

@@ -19,7 +19,7 @@
 			and	uid	=	#{uid}
 			and	uid	=	#{uid}
 		</if> 
 		</if> 
 		<if test="username != null and username != ''">
 		<if test="username != null and username != ''">
-			and	username	like concat('%',#{username},'%')
+			and	username	=   #{username}
 		</if> 
 		</if> 
 		<if test="displayName != null and displayName != ''">
 		<if test="displayName != null and displayName != ''">
 			and	displayname	like concat('%',#{displayName},'%')
 			and	displayname	like concat('%',#{displayName},'%')

+ 26 - 1
maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/MaxKeyConfig.java

@@ -17,9 +17,13 @@
 
 
 package org.maxkey;
 package org.maxkey;
 
 
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 import java.util.Properties;
 import java.util.Properties;
+import java.util.stream.Collectors;
 
 
 import org.maxkey.authn.realm.jdbc.JdbcAuthenticationRealm;
 import org.maxkey.authn.realm.jdbc.JdbcAuthenticationRealm;
 import org.maxkey.authn.realm.ldap.LdapAuthenticationRealm;
 import org.maxkey.authn.realm.ldap.LdapAuthenticationRealm;
@@ -31,6 +35,7 @@ import org.maxkey.authn.realm.activedirectory.ActiveDirectoryServer;
 import org.maxkey.authn.support.kerberos.KerberosProxy;
 import org.maxkey.authn.support.kerberos.KerberosProxy;
 import org.maxkey.authn.support.kerberos.RemoteKerberosService;
 import org.maxkey.authn.support.kerberos.RemoteKerberosService;
 import org.maxkey.authn.support.rememberme.AbstractRemeberMeService;
 import org.maxkey.authn.support.rememberme.AbstractRemeberMeService;
+import org.maxkey.configuration.EmailConfig;
 import org.maxkey.constants.ConstantsPersistence;
 import org.maxkey.constants.ConstantsPersistence;
 import org.maxkey.constants.ConstantsProperties;
 import org.maxkey.constants.ConstantsProperties;
 import org.maxkey.password.onetimepwd.AbstractOtpAuthn;
 import org.maxkey.password.onetimepwd.AbstractOtpAuthn;
@@ -57,6 +62,8 @@ import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.PropertySource;
 import org.springframework.context.annotation.PropertySource;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.security.crypto.password.PasswordEncoder;
 
 
@@ -216,14 +223,32 @@ public class MaxKeyConfig  implements InitializingBean {
     
     
     @Bean(name = "mailOtpAuthn")
     @Bean(name = "mailOtpAuthn")
     public MailOtpAuthn mailOtpAuthn(
     public MailOtpAuthn mailOtpAuthn(
+            EmailConfig emailConfig,
             @Value("${spring.mail.properties.mailotp.message.subject}")
             @Value("${spring.mail.properties.mailotp.message.subject}")
             String messageSubject,
             String messageSubject,
             @Value("${spring.mail.properties.mailotp.message.template}")
             @Value("${spring.mail.properties.mailotp.message.template}")
-            String messageTemplate
+            String messageTemplate,
+            @Value("${spring.mail.properties.mailotp.message.validity}")
+            int messageValidity,
+            @Value("${spring.mail.properties.mailotp.message.type}")
+            String messageType
             ) {
             ) {
+        if(messageType!= null && messageType.equalsIgnoreCase("html")) {
+            Resource resource = new ClassPathResource("messages/email/forgotpassword.html");
+            try {
+                BufferedReader bufferedReader =new BufferedReader(new InputStreamReader(resource.getInputStream()));
+                messageTemplate = bufferedReader.lines().collect(Collectors.joining("\n"));
+                bufferedReader.close();
+            } catch (IOException e) {
+                 _logger.error("mailOtpAuthn IOException ",e);
+            }
+        }
+        _logger.trace("messageTemplate \n" +messageTemplate);
         MailOtpAuthn mailOtpAuthn = new MailOtpAuthn();
         MailOtpAuthn mailOtpAuthn = new MailOtpAuthn();
         mailOtpAuthn.setSubject(messageSubject);
         mailOtpAuthn.setSubject(messageSubject);
         mailOtpAuthn.setMessageTemplate(messageTemplate);
         mailOtpAuthn.setMessageTemplate(messageTemplate);
+        mailOtpAuthn.setEmailConfig(emailConfig);
+        mailOtpAuthn.setInterval(messageValidity);
         _logger.debug("MailOtpAuthn inited.");
         _logger.debug("MailOtpAuthn inited.");
         return mailOtpAuthn;
         return mailOtpAuthn;
     }
     }

+ 28 - 11
maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/ForgotPasswordContorller.java

@@ -17,11 +17,12 @@
 
 
 package org.maxkey.web.contorller;
 package org.maxkey.web.contorller;
 
 
-import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.regex.Pattern;
 
 
+import org.maxkey.configuration.EmailConfig;
 import org.maxkey.entity.UserInfo;
 import org.maxkey.entity.UserInfo;
 import org.maxkey.password.onetimepwd.AbstractOtpAuthn;
 import org.maxkey.password.onetimepwd.AbstractOtpAuthn;
+import org.maxkey.persistence.db.PasswordPolicyValidator;
 import org.maxkey.persistence.service.UserInfoService;
 import org.maxkey.persistence.service.UserInfoService;
 import org.maxkey.web.WebConstants;
 import org.maxkey.web.WebConstants;
 import org.maxkey.web.WebContext;
 import org.maxkey.web.WebContext;
@@ -45,6 +46,9 @@ public class ForgotPasswordContorller {
     Pattern mobileRegex = Pattern.compile(
     Pattern mobileRegex = Pattern.compile(
             "^(13[4,5,6,7,8,9]|15[0,8,9,1,7]|188|187)\\\\d{8}$");
             "^(13[4,5,6,7,8,9]|15[0,8,9,1,7]|188|187)\\\\d{8}$");
     
     
+    @Autowired
+    EmailConfig emailConfig;
+    
     public class ForgotType{
     public class ForgotType{
         public final static int NOTFOUND = 1;
         public final static int NOTFOUND = 1;
         public final static int EMAIL = 2;
         public final static int EMAIL = 2;
@@ -84,16 +88,24 @@ public class ForgotPasswordContorller {
         UserInfo userInfo = null;
         UserInfo userInfo = null;
         if (captcha != null && captcha
         if (captcha != null && captcha
                 .equals(WebContext.getSession().getAttribute(
                 .equals(WebContext.getSession().getAttribute(
-                                WebConstants.KAPTCHA_SESSION_KEY).toString())) {
+                                WebConstants.KAPTCHA_SESSION_KEY).toString())) {            
+            if(mobileRegex.matcher(emailMobile).matches()) {
+            	forgotType = ForgotType.MOBILE;
+            }else if(emailRegex.matcher(emailMobile).matches()) {
+            	forgotType = ForgotType.EMAIL;
+            }else {
+            	forgotType = ForgotType.EMAIL;
+            	emailMobile =emailMobile + "@" + emailConfig.getSmtpHost().substring(emailConfig.getSmtpHost().indexOf(".")+1);
+            }
+            
             userInfo = userInfoService.queryUserInfoByEmailMobile(emailMobile);
             userInfo = userInfoService.queryUserInfoByEmailMobile(emailMobile);
             
             
-            Matcher matcher = emailRegex.matcher(emailMobile);
-            if (matcher.matches() && null != userInfo) {
-            	mailOtpAuthn.produce(userInfo);
-                forgotType = ForgotType.EMAIL;
-            }else if (null != userInfo) {
-            	smsOtpAuthn.produce(userInfo);
-                forgotType = ForgotType.MOBILE;
+            if(null != userInfo) {
+	            if (forgotType == ForgotType.EMAIL ) {
+	            	mailOtpAuthn.produce(userInfo);
+	            }else if (forgotType == ForgotType.MOBILE) {
+	            	smsOtpAuthn.produce(userInfo);
+	            }
             }
             }
            
            
         }else {
         }else {
@@ -129,8 +141,13 @@ public class ForgotPasswordContorller {
             if ((forgotType == ForgotType.EMAIL && mailOtpAuthn.validate(userInfo, captcha)) ||
             if ((forgotType == ForgotType.EMAIL && mailOtpAuthn.validate(userInfo, captcha)) ||
                     (forgotType == ForgotType.MOBILE && smsOtpAuthn.validate(userInfo, captcha))
                     (forgotType == ForgotType.MOBILE && smsOtpAuthn.validate(userInfo, captcha))
                 ) {
                 ) {
-                userInfoService.changePassword(userInfo,true);
-                modelAndView.addObject("passwordResetResult", PasswordResetResult.SUCCESS);
+                if(userInfoService.changePassword(userInfo,true)) {
+                	modelAndView.addObject("passwordResetResult", PasswordResetResult.SUCCESS);
+                }else {
+                	;
+                	modelAndView.addObject("validate_result", WebContext.getAttribute(PasswordPolicyValidator.PASSWORD_POLICY_VALIDATE_RESULT));
+                	modelAndView.addObject("passwordResetResult", PasswordResetResult.PASSWORDERROR);
+                }
             } else {
             } else {
                 modelAndView.addObject("passwordResetResult", PasswordResetResult.CAPTCHAERROR);
                 modelAndView.addObject("passwordResetResult", PasswordResetResult.CAPTCHAERROR);
             }
             }

+ 2 - 1
maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/historys/contorller/HistoryLoginAppsController.java

@@ -23,6 +23,7 @@ import org.apache.mybatis.jpa.persistence.JpaPageResults;
 import org.maxkey.entity.HistoryLoginApps;
 import org.maxkey.entity.HistoryLoginApps;
 import org.maxkey.persistence.service.HistoryLoginAppsService;
 import org.maxkey.persistence.service.HistoryLoginAppsService;
 import org.maxkey.util.DateUtils;
 import org.maxkey.util.DateUtils;
+import org.maxkey.web.WebContext;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -66,7 +67,7 @@ public class HistoryLoginAppsController {
             @ModelAttribute("historyLoginApps") HistoryLoginApps historyLoginApps) {
             @ModelAttribute("historyLoginApps") HistoryLoginApps historyLoginApps) {
         _logger.debug("history/loginApps/grid/ logsGrid() " + historyLoginApps);
         _logger.debug("history/loginApps/grid/ logsGrid() " + historyLoginApps);
         historyLoginApps.setId(null);
         historyLoginApps.setId(null);
-
+        historyLoginApps.setUsername(WebContext.getUserInfo().getUsername());
         return historyLoginAppsService.queryPageResults(historyLoginApps);
         return historyLoginAppsService.queryPageResults(historyLoginApps);
 
 
     }
     }

+ 9 - 11
maxkey-webs/maxkey-web-maxkey/src/main/resources/application-http.properties

@@ -95,7 +95,8 @@ mybatis.table-column-case=lowercase
 #spring.mail.properties.sender=maxkey@163.com
 #spring.mail.properties.sender=maxkey@163.com
 spring.mail.properties.mailotp.message.subject=MaxKey One Time PassWord
 spring.mail.properties.mailotp.message.subject=MaxKey One Time PassWord
 spring.mail.properties.mailotp.message.template={0} You Token is {1} , it validity in {2}  minutes.
 spring.mail.properties.mailotp.message.template={0} You Token is {1} , it validity in {2}  minutes.
-
+spring.mail.properties.mailotp.message.type=html
+spring.mail.properties.mailotp.message.validity=300
 ############################################################################
 ############################################################################
 #freemarker configuration                                                  #
 #freemarker configuration                                                  #
 ############################################################################
 ############################################################################
@@ -139,23 +140,20 @@ spring.session.store-type=none
 #Kafka for connectors configuration                                        #
 #Kafka for connectors configuration                                        #
 ############################################################################
 ############################################################################
 spring.kafka.bootstrap-servers=localhost:9092
 spring.kafka.bootstrap-servers=localhost:9092
-###########\u3010\u521d\u59cb\u5316\u751f\u4ea7\u8005\u914d\u7f6e\u3011###########
-# \u91cd\u8bd5\u6b21\u6570
+# retries
 spring.kafka.producer.retries=0
 spring.kafka.producer.retries=0
-# \u5e94\u7b54\u7ea7\u522b:\u591a\u5c11\u4e2a\u5206\u533a\u526f\u672c\u5907\u4efd\u5b8c\u6210\u65f6\u5411\u751f\u4ea7\u8005\u53d1\u9001ack\u786e\u8ba4(\u53ef\u90090\u30011\u3001all/-1)
+# acks
 spring.kafka.producer.acks=1
 spring.kafka.producer.acks=1
-# \u6279\u91cf\u5927\u5c0f
+# batch-size
 spring.kafka.producer.batch-size=16384
 spring.kafka.producer.batch-size=16384
-# \u63d0\u4ea4\u5ef6\u65f6
+# linger.ms
 spring.kafka.producer.properties.linger.ms=0
 spring.kafka.producer.properties.linger.ms=0
-# \u5f53\u751f\u4ea7\u7aef\u79ef\u7d2f\u7684\u6d88\u606f\u8fbe\u5230batch-size\u6216\u63a5\u6536\u5230\u6d88\u606flinger.ms\u540e,\u751f\u4ea7\u8005\u5c31\u4f1a\u5c06\u6d88\u606f\u63d0\u4ea4\u7ed9kafka
-# linger.ms\u4e3a0\u8868\u793a\u6bcf\u63a5\u6536\u5230\u4e00\u6761\u6d88\u606f\u5c31\u63d0\u4ea4\u7ed9kafka,\u8fd9\u65f6\u5019batch-size\u5176\u5b9e\u5c31\u6ca1\u7528\u4e86
-# \u751f\u4ea7\u7aef\u7f13\u51b2\u533a\u5927\u5c0f
+# buffer-memory
 spring.kafka.producer.buffer-memory = 33554432
 spring.kafka.producer.buffer-memory = 33554432
-# Kafka\u63d0\u4f9b\u7684\u5e8f\u5217\u5316\u548c\u53cd\u5e8f\u5217\u5316\u7c7b
+# serializer
 spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
 spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
 spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
 spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
-# \u81ea\u5b9a\u4e49\u5206\u533a\u5668
+# partitioner
 # spring.kafka.producer.properties.partitioner.class=com.felix.kafka.producer.CustomizePartitioner
 # spring.kafka.producer.properties.partitioner.class=com.felix.kafka.producer.CustomizePartitioner
 
 
 ############################################################################
 ############################################################################

+ 11 - 12
maxkey-webs/maxkey-web-maxkey/src/main/resources/application-https.properties

@@ -95,6 +95,8 @@ mybatis.table-column-case=lowercase
 #spring.mail.properties.sender=maxkey@163.com
 #spring.mail.properties.sender=maxkey@163.com
 spring.mail.properties.mailotp.message.subject=MaxKey One Time PassWord
 spring.mail.properties.mailotp.message.subject=MaxKey One Time PassWord
 spring.mail.properties.mailotp.message.template={0} You Token is {1} , it validity in {2}  minutes.
 spring.mail.properties.mailotp.message.template={0} You Token is {1} , it validity in {2}  minutes.
+spring.mail.properties.mailotp.message.type=html
+spring.mail.properties.mailotp.message.validity=300
 
 
 ############################################################################
 ############################################################################
 #freemarker configuration                                                  #
 #freemarker configuration                                                  #
@@ -139,24 +141,21 @@ spring.session.store-type=none
 #Kafka for connectors configuration                                        #
 #Kafka for connectors configuration                                        #
 ############################################################################
 ############################################################################
 spring.kafka.bootstrap-servers=localhost:9092
 spring.kafka.bootstrap-servers=localhost:9092
-###########\u3010\u521d\u59cb\u5316\u751f\u4ea7\u8005\u914d\u7f6e\u3011###########
-# \u91cd\u8bd5\u6b21\u6570
+# retries
 spring.kafka.producer.retries=0
 spring.kafka.producer.retries=0
-# \u5e94\u7b54\u7ea7\u522b:\u591a\u5c11\u4e2a\u5206\u533a\u526f\u672c\u5907\u4efd\u5b8c\u6210\u65f6\u5411\u751f\u4ea7\u8005\u53d1\u9001ack\u786e\u8ba4(\u53ef\u90090\u30011\u3001all/-1)
+# acks
 spring.kafka.producer.acks=1
 spring.kafka.producer.acks=1
-# \u6279\u91cf\u5927\u5c0f
+# batch-size
 spring.kafka.producer.batch-size=16384
 spring.kafka.producer.batch-size=16384
-# \u63d0\u4ea4\u5ef6\u65f6
+# linger.ms
 spring.kafka.producer.properties.linger.ms=0
 spring.kafka.producer.properties.linger.ms=0
-# \u5f53\u751f\u4ea7\u7aef\u79ef\u7d2f\u7684\u6d88\u606f\u8fbe\u5230batch-size\u6216\u63a5\u6536\u5230\u6d88\u606flinger.ms\u540e,\u751f\u4ea7\u8005\u5c31\u4f1a\u5c06\u6d88\u606f\u63d0\u4ea4\u7ed9kafka
-# linger.ms\u4e3a0\u8868\u793a\u6bcf\u63a5\u6536\u5230\u4e00\u6761\u6d88\u606f\u5c31\u63d0\u4ea4\u7ed9kafka,\u8fd9\u65f6\u5019batch-size\u5176\u5b9e\u5c31\u6ca1\u7528\u4e86
-# \u751f\u4ea7\u7aef\u7f13\u51b2\u533a\u5927\u5c0f
+# buffer-memory
 spring.kafka.producer.buffer-memory = 33554432
 spring.kafka.producer.buffer-memory = 33554432
-# Kafka\u63d0\u4f9b\u7684\u5e8f\u5217\u5316\u548c\u53cd\u5e8f\u5217\u5316\u7c7b
+# serializer
 spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
 spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
 spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
 spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
-# \u81ea\u5b9a\u4e49\u5206\u533a\u5668
-# spring.kafka.producer.properties.partitioner.class=com.felix.kafka.producer.CustomizePartitioner
+# partitioner
+#spring.kafka.producer.properties.partitioner.class=com.felix.kafka.producer.CustomizePartitioner
 
 
 ############################################################################
 ############################################################################
 #Management endpoints configuration                                        #
 #Management endpoints configuration                                        #
@@ -366,7 +365,7 @@ maxkey.socialsignon.wechatopen.sortorder=2
 #work weixin
 #work weixin
 maxkey.socialsignon.workweixin.provider=workweixin
 maxkey.socialsignon.workweixin.provider=workweixin
 maxkey.socialsignon.workweixin.provider.name=\u4F01\u4E1A\u5fae\u4fe1
 maxkey.socialsignon.workweixin.provider.name=\u4F01\u4E1A\u5fae\u4fe1
-maxkey.socialsignon.workweixin.icon=images/social/wechat.png
+maxkey.socialsignon.workweixin.icon=images/social/wechat_enterprise.png
 maxkey.socialsignon.workweixin.client.id=wx00d052e8f417f8f9
 maxkey.socialsignon.workweixin.client.id=wx00d052e8f417f8f9
 maxkey.socialsignon.workweixin.client.secret=lIy40iP0z4D65eJaWDNoe-vSlttmqY2WGJBygbM0TlY
 maxkey.socialsignon.workweixin.client.secret=lIy40iP0z4D65eJaWDNoe-vSlttmqY2WGJBygbM0TlY
 maxkey.socialsignon.workweixin.agent.id=1000002
 maxkey.socialsignon.workweixin.agent.id=1000002

+ 5 - 0
maxkey-webs/maxkey-web-maxkey/src/main/resources/messages/email/forgotpassword.html

@@ -0,0 +1,5 @@
+尊敬的用户{0}:<br> 
+请复制下面的验证码,并返回页面提交以继续之前的步骤。 <br> 
+<p><b>{1}</b></p> 
+有效期为{2}分钟.<br> 
+如果您没有申请发送该邮件,请忽略。

+ 4 - 0
maxkey-webs/maxkey-web-maxkey/src/main/resources/messages/message.properties

@@ -218,8 +218,12 @@ button.text.expandsearch=\u5c55\u5f00
 button.text.collapsesearch=\u6536\u7f29
 button.text.collapsesearch=\u6536\u7f29
 
 
 forgotpassword.emailmobile=\u90ae\u7bb1\u6216\u624b\u673a
 forgotpassword.emailmobile=\u90ae\u7bb1\u6216\u624b\u673a
+forgotpassword.email=\u90ae\u7bb1
+forgotpassword.mobile=\u624b\u673a
 forgotpassword.nextstep=\u4e0b\u4e00\u6b65
 forgotpassword.nextstep=\u4e0b\u4e00\u6b65
 forgotpassword.resetpwd.notfound.prefix=\u90ae\u7bb1\u6216\u624b\u673a\u53f7
 forgotpassword.resetpwd.notfound.prefix=\u90ae\u7bb1\u6216\u624b\u673a\u53f7
+forgotpassword.resetpwd.notfound.prefix.email=\u90ae\u7bb1
+forgotpassword.resetpwd.notfound.prefix.mobile=\u624b\u673a\u53f7
 forgotpassword.resetpwd.notfound.suffix=\u4e0d\u5b58\u5728,\u8bf7
 forgotpassword.resetpwd.notfound.suffix=\u4e0d\u5b58\u5728,\u8bf7
 forgotpassword.backstep=\u91cd\u65b0\u8f93\u5165
 forgotpassword.backstep=\u91cd\u65b0\u8f93\u5165
 forgotpassword.pwdreseted.password=\u8f93\u5165\u5bc6\u7801\u6216\u786e\u8ba4\u5bc6\u7801\u9519\u8bef\uff0c\u8bf7
 forgotpassword.pwdreseted.password=\u8f93\u5165\u5bc6\u7801\u6216\u786e\u8ba4\u5bc6\u7801\u9519\u8bef\uff0c\u8bf7

+ 4 - 0
maxkey-webs/maxkey-web-maxkey/src/main/resources/messages/message_en.properties

@@ -217,8 +217,12 @@ button.text.expandsearch=Expand
 button.text.collapsesearch=Collapse
 button.text.collapsesearch=Collapse
 
 
 forgotpassword.emailmobile=Email OR Mobile
 forgotpassword.emailmobile=Email OR Mobile
+forgotpassword.email=Email
+forgotpassword.mobile=Mobile
 forgotpassword.nextstep=Next
 forgotpassword.nextstep=Next
 forgotpassword.resetpwd.notfound.prefix=Email OR Mobile
 forgotpassword.resetpwd.notfound.prefix=Email OR Mobile
+forgotpassword.resetpwd.notfound.prefix.email=Email
+forgotpassword.resetpwd.notfound.prefix.mobile=Mobile
 forgotpassword.resetpwd.notfound.suffix=not found,pls
 forgotpassword.resetpwd.notfound.suffix=not found,pls
 forgotpassword.backstep=Retry
 forgotpassword.backstep=Retry
 forgotpassword.pwdreseted.password=password error or password not eq the confirm password,pls 
 forgotpassword.pwdreseted.password=password error or password not eq the confirm password,pls 

+ 4 - 0
maxkey-webs/maxkey-web-maxkey/src/main/resources/messages/message_zh_CN.properties

@@ -218,8 +218,12 @@ button.text.expandsearch=\u5c55\u5f00
 button.text.collapsesearch=\u6536\u7f29
 button.text.collapsesearch=\u6536\u7f29
 
 
 forgotpassword.emailmobile=\u90ae\u7bb1\u6216\u624b\u673a
 forgotpassword.emailmobile=\u90ae\u7bb1\u6216\u624b\u673a
+forgotpassword.email=\u90ae\u7bb1
+forgotpassword.mobile=\u624b\u673a
 forgotpassword.nextstep=\u4e0b\u4e00\u6b65
 forgotpassword.nextstep=\u4e0b\u4e00\u6b65
 forgotpassword.resetpwd.notfound.prefix=\u90ae\u7bb1\u6216\u624b\u673a\u53f7
 forgotpassword.resetpwd.notfound.prefix=\u90ae\u7bb1\u6216\u624b\u673a\u53f7
+forgotpassword.resetpwd.notfound.prefix.email=\u90ae\u7bb1
+forgotpassword.resetpwd.notfound.prefix.mobile=\u624b\u673a\u53f7
 forgotpassword.resetpwd.notfound.suffix=\u4e0d\u5b58\u5728,\u8bf7
 forgotpassword.resetpwd.notfound.suffix=\u4e0d\u5b58\u5728,\u8bf7
 forgotpassword.backstep=\u91cd\u65b0\u8f93\u5165
 forgotpassword.backstep=\u91cd\u65b0\u8f93\u5165
 forgotpassword.pwdreseted.password=\u8f93\u5165\u5bc6\u7801\u6216\u786e\u8ba4\u5bc6\u7801\u9519\u8bef\uff0c\u8bf7
 forgotpassword.pwdreseted.password=\u8f93\u5165\u5bc6\u7801\u6216\u786e\u8ba4\u5bc6\u7801\u9519\u8bef\uff0c\u8bf7

+ 2 - 1
maxkey-webs/maxkey-web-maxkey/src/main/resources/templates/views/forgotpassword/pwdreseted.ftl

@@ -15,7 +15,8 @@
 <div class="col-md-8">
 <div class="col-md-8">
   <#if 3 == passwordResetResult>
   <#if 3 == passwordResetResult>
   	<@locale code="forgotpassword.pwdreseted.password"/>
   	<@locale code="forgotpassword.pwdreseted.password"/>
-  	<a href="javascript:history.go(-1);"><@locale code="forgotpassword.backstep"/></a >
+  	<a href="<@base/>/forgotpassword/forward"><@locale code="forgotpassword.backstep"/></a >
+    <br>${validate_result}
   	
   	
   </#if>
   </#if>
   <#if 2 == passwordResetResult>
   <#if 2 == passwordResetResult>

+ 233 - 0
maxkey-webs/maxkey-web-mgt/src/main/resources/application-http.properties

@@ -0,0 +1,233 @@
+############################################################################
+#  Copyright [2021] [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.
+############################################################################
+#MaxKey Server  configuration                                              #
+############################################################################
+#server port
+server.port=9527
+#web app context path
+server.servlet.context-path=/maxkey-mgt
+spring.servlet.multipart.enabled=true
+spring.servlet.multipart.max-file-size=4194304
+#server.servlet.encoding.charset.from=
+#server.servlet.encoding.charset=
+#server.servlet.encoding.enabled=
+#server.servlet.encoding.force=
+
+############################################################################
+#database configuration 
+#   supported database
+#       mysql
+#       highgo
+#       postgresql
+############################################################################
+spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
+#mysql
+spring.datasource.username=root
+spring.datasource.password=maxkey
+spring.datasource.url=jdbc:mysql://localhost/maxkey?autoReconnect=true&characterEncoding=UTF-8&serverTimezone=UTC
+spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+#highgo
+#spring.datasource.username=highgo
+#spring.datasource.password=High@123
+#spring.datasource.url=jdbc:highgo://192.168.56.107:5866/highgo?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+#spring.datasource.driver-class-name=com.highgo.jdbc.Driver
+#postgresql
+#spring.datasource.username=root
+#spring.datasource.password=maxkey!
+#spring.datasource.url=jdbc:postgresql://localhost/maxkey?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+#spring.datasource.driver-class-name=org.postgresql.Driver
+
+#mybatis
+mybatis.dialect=mysql
+mybatis.type-aliases-package=org.maxkey.entity,org.maxkey.entity.apps,
+mybatis.mapper-locations=classpath*:/org/maxkey/persistence/mapper/xml/${mybatis.dialect}/*.xml
+mybatis.table-column-snowflake-datacenter-id=1
+mybatis.table-column-snowflake-machine-id=1
+mybatis.table-column-escape=false
+mybatis.table-column-case=lowercase
+
+############################################################################
+#redis server  configuration                                               #
+############################################################################
+#spring.redis.host=127.0.0.1
+#spring.redis.port=6379
+#spring.redis.password=password
+#spring.redis.timeout=10000
+#spring.redis.jedis.pool.max-wait=1000
+#spring.redis.jedis.pool.max-idle=200
+#spring.redis.lettuce.pool.max-active=-1
+#spring.redis.lettuce.pool.min-idle=0
+
+############################################################################
+#mail configuration                                                        #
+############################################################################
+#spring.mail.default-encoding=utf-8
+#spring.mail.host=smtp.163.com
+#spring.mail.port=465
+#spring.mail.username=maxkey@163.com
+#spring.mail.password=password
+#spring.mail.protocol=smtp
+#spring.mail.properties.ssl=true
+#spring.mail.properties.sender=maxkey@163.com
+
+############################################################################
+#freemarker configuration                                                  #
+############################################################################
+spring.freemarker.template-loader-path=classpath:/templates/views
+spring.freemarker.cache=false
+spring.freemarker.charset=UTF-8
+spring.freemarker.check-template-location=true
+spring.freemarker.content-type=text/html
+spring.freemarker.expose-request-attributes=false
+spring.freemarker.expose-session-attributes=false
+spring.freemarker.request-context-attribute=request
+spring.freemarker.suffix=.ftl
+#spring.freemarker.settings.classic_compatible=true
+
+############################################################################
+#static resources configuration                                            #
+############################################################################
+spring.mvc.static-path-pattern=/static/**
+spring.messages.basename=classpath:messages/message
+spring.messages.encoding=UTF-8
+
+############################################################################
+#Main.banner-mode configuration                                            #
+############################################################################
+spring.main.banner-mode=log
+spring.main.allow-bean-definition-overriding=true
+
+############################################################################
+#Spring Session  configuration                                             #
+############################################################################
+#Session store type.
+spring.session.store-type=none
+#spring.session.store-type=redis
+# Session timeout. If a duration suffix is not specified, seconds is used.
+#server.servlet.session.timeout=1800
+# Sessions flush mode.
+#spring.session.redis.flush-mode=on_save 
+# Namespace for keys used to store sessions.
+#spring.session.redis.namespace=spring:session 
+
+############################################################################
+#Kafka for connectors configuration                                        #
+############################################################################
+spring.kafka.bootstrap-servers=localhost:9092
+# retries
+spring.kafka.producer.retries=0
+# acks
+spring.kafka.producer.acks=1
+# batch-size
+spring.kafka.producer.batch-size=16384
+# linger.ms
+spring.kafka.producer.properties.linger.ms=0
+# buffer-memory
+spring.kafka.producer.buffer-memory = 33554432
+# serializer
+spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
+spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
+# partitioner
+# spring.kafka.producer.properties.partitioner.class=com.felix.kafka.producer.CustomizePartitioner
+
+############################################################################
+#Management endpoints configuration                                        #
+############################################################################
+#management.server.port=9522
+#management.server.servlet.context-path=/maxkey-mgt-actuate
+#management.endpoints.enabled-by-default=false
+management.security.enabled=false
+#management.endpoints.jmx.exposure.include=health,info
+management.endpoints.web.exposure.include=metrics,health,info,env,beans
+
+############################################################################
+#domain name configuration                                                 #
+############################################################################
+maxkey.server.scheme=http
+maxkey.server.basedomain=maxkey.top
+maxkey.server.domain=sso.${maxkey.server.basedomain}
+maxkey.server.name=${maxkey.server.scheme}://${maxkey.server.domain}
+maxkey.server.uri=${maxkey.server.name}:9527/maxkey-mgt
+#default.uri
+maxkey.server.default.uri=${maxkey.server.uri}/main
+maxkey.maxkey.uri=https://${maxkey.server.domain}/maxkey
+#InMemory 0 , Redis 2 
+maxkey.server.persistence=0
+#identity
+maxkey.identity.kafkasupport=false
+
+############################################################################
+#Login configuration                                                       #
+############################################################################
+#enable captcha
+maxkey.login.captcha=true
+#text or arithmetic
+maxkey.login.captcha.type=text
+#enable two factor,use one time password
+maxkey.login.mfa=false
+#enable social sign on
+maxkey.login.socialsignon=false
+#Enable kerberos/SPNEGO
+maxkey.login.kerberos=false
+#wsFederation
+maxkey.login.wsfederation=false
+#remeberme
+maxkey.login.remeberme=false
+#validity
+maxkey.login.remeberme.validity=0
+#default.uri
+#to appList page
+maxkey.login.default.uri=appList
+#ipaddress whitelist
+maxkey.ipaddress.whitelist=false
+
+#############################################################################
+#SAML V2.0 configuration                                                    #
+#############################################################################
+#			saml common
+maxkey.saml.v20.max.parser.pool.size=2
+maxkey.saml.v20.assertion.validity.time.ins.seconds=90
+maxkey.saml.v20.replay.cache.life.in.millis=14400000
+maxkey.saml.v20.issue.instant.check.clock.skew.in.seconds=90
+maxkey.saml.v20.issue.instant.check.validity.time.in.seconds=300
+#saml idp keystore
+maxkey.saml.v20.idp.keystore.password=maxkey
+maxkey.saml.v20.idp.keystore.private.key.password=maxkey
+maxkey.saml.v20.idp.keystore=classpath\:config/samlServerKeystore.jks
+#keystore id for sec
+maxkey.saml.v20.idp.issuing.entity.id=maxkey.top
+maxkey.saml.v20.idp.issuer=https://sso.maxkey.top/maxkey/saml
+maxkey.saml.v20.idp.receiver.endpoint=https\://sso.maxkey.top/
+#saml sp keystore
+maxkey.saml.v20.sp.keystore.password=maxkey
+maxkey.saml.v20.sp.keystore.private.key.password=maxkey
+maxkey.saml.v20.sp.keystore=classpath\:config/samlClientKeystore.jks
+maxkey.saml.v20.sp.issuing.entity.id=client.maxkey.org
+
+#############################################################################
+#OIDC V1.0 METADATA configuration                                           #
+#############################################################################
+maxkey.oidc.metadata.issuer=https://${maxkey.server.domain}/maxkey
+maxkey.oidc.metadata.authorizationEndpoint=${maxkey.server.name}/maxkey/authz/oauth/v20/authorize
+maxkey.oidc.metadata.tokenEndpoint=${maxkey.server.name}/maxkey/authz/oauth/v20/token
+maxkey.oidc.metadata.userinfoEndpoint=${maxkey.server.name}/maxkey/api/connect/userinfo
+
+#############################################################################
+#Job Scheduler                                                              #
+#############################################################################
+#one hour for refresh dynamic groups  
+maxkey.job.cron.dynamicgroups=0 0 0/1 * * ?
+maxkey.job.cron.enable=true

+ 2 - 221
maxkey-webs/maxkey-web-mgt/src/main/resources/application.properties

@@ -20,225 +20,6 @@ application.name=MaxKey-Mgt
 application.formatted-version=v2.8.2 GA
 application.formatted-version=v2.8.2 GA
 
 
 ############################################################################
 ############################################################################
-#MaxKey Server  configuration                                              #
+#spring.profiles.active http; default http                                 #
 ############################################################################
 ############################################################################
-#server port
-server.port=9527
-#web app context path
-server.servlet.context-path=/maxkey-mgt
-spring.servlet.multipart.enabled=true
-spring.servlet.multipart.max-file-size=4194304
-#server.servlet.encoding.charset.from=
-#server.servlet.encoding.charset=
-#server.servlet.encoding.enabled=
-#server.servlet.encoding.force=
-
-############################################################################
-#database configuration 
-#   supported database
-#       mysql
-#       highgo
-#       postgresql
-############################################################################
-spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
-#mysql
-spring.datasource.username=root
-spring.datasource.password=maxkey
-spring.datasource.url=jdbc:mysql://localhost/maxkey?autoReconnect=true&characterEncoding=UTF-8&serverTimezone=UTC
-spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
-#highgo
-#spring.datasource.username=highgo
-#spring.datasource.password=High@123
-#spring.datasource.url=jdbc:highgo://192.168.56.107:5866/highgo?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
-#spring.datasource.driver-class-name=com.highgo.jdbc.Driver
-#postgresql
-#spring.datasource.username=root
-#spring.datasource.password=maxkey!
-#spring.datasource.url=jdbc:postgresql://localhost/maxkey?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
-#spring.datasource.driver-class-name=org.postgresql.Driver
-
-#mybatis
-mybatis.dialect=mysql
-mybatis.type-aliases-package=org.maxkey.entity,org.maxkey.entity.apps,
-mybatis.mapper-locations=classpath*:/org/maxkey/persistence/mapper/xml/${mybatis.dialect}/*.xml
-mybatis.table-column-snowflake-datacenter-id=1
-mybatis.table-column-snowflake-machine-id=1
-mybatis.table-column-escape=false
-mybatis.table-column-case=lowercase
-
-############################################################################
-#redis server  configuration                                               #
-############################################################################
-#spring.redis.host=127.0.0.1
-#spring.redis.port=6379
-#spring.redis.password=password
-#spring.redis.timeout=10000
-#spring.redis.jedis.pool.max-wait=1000
-#spring.redis.jedis.pool.max-idle=200
-#spring.redis.lettuce.pool.max-active=-1
-#spring.redis.lettuce.pool.min-idle=0
-
-############################################################################
-#mail configuration                                                        #
-############################################################################
-#spring.mail.default-encoding=utf-8
-#spring.mail.host=smtp.163.com
-#spring.mail.port=465
-#spring.mail.username=maxkey@163.com
-#spring.mail.password=password
-#spring.mail.protocol=smtp
-#spring.mail.properties.ssl=true
-#spring.mail.properties.sender=maxkey@163.com
-
-############################################################################
-#freemarker configuration                                                  #
-############################################################################
-spring.freemarker.template-loader-path=classpath:/templates/views
-spring.freemarker.cache=false
-spring.freemarker.charset=UTF-8
-spring.freemarker.check-template-location=true
-spring.freemarker.content-type=text/html
-spring.freemarker.expose-request-attributes=false
-spring.freemarker.expose-session-attributes=false
-spring.freemarker.request-context-attribute=request
-spring.freemarker.suffix=.ftl
-#spring.freemarker.settings.classic_compatible=true
-
-############################################################################
-#static resources configuration                                            #
-############################################################################
-spring.mvc.static-path-pattern=/static/**
-spring.messages.basename=classpath:messages/message
-spring.messages.encoding=UTF-8
-
-############################################################################
-#Main.banner-mode configuration                                            #
-############################################################################
-spring.main.banner-mode=log
-spring.main.allow-bean-definition-overriding=true
-
-############################################################################
-#Spring Session  configuration                                             #
-############################################################################
-#Session store type.
-spring.session.store-type=none
-#spring.session.store-type=redis
-# Session timeout. If a duration suffix is not specified, seconds is used.
-#server.servlet.session.timeout=1800
-# Sessions flush mode.
-#spring.session.redis.flush-mode=on_save 
-# Namespace for keys used to store sessions.
-#spring.session.redis.namespace=spring:session 
-
-############################################################################
-#Kafka for connectors configuration                                        #
-############################################################################
-spring.kafka.bootstrap-servers=localhost:9092
-###########\u3010\u521d\u59cb\u5316\u751f\u4ea7\u8005\u914d\u7f6e\u3011###########
-# \u91cd\u8bd5\u6b21\u6570
-spring.kafka.producer.retries=0
-# \u5e94\u7b54\u7ea7\u522b:\u591a\u5c11\u4e2a\u5206\u533a\u526f\u672c\u5907\u4efd\u5b8c\u6210\u65f6\u5411\u751f\u4ea7\u8005\u53d1\u9001ack\u786e\u8ba4(\u53ef\u90090\u30011\u3001all/-1)
-spring.kafka.producer.acks=1
-# \u6279\u91cf\u5927\u5c0f
-spring.kafka.producer.batch-size=16384
-# \u63d0\u4ea4\u5ef6\u65f6
-spring.kafka.producer.properties.linger.ms=0
-# \u5f53\u751f\u4ea7\u7aef\u79ef\u7d2f\u7684\u6d88\u606f\u8fbe\u5230batch-size\u6216\u63a5\u6536\u5230\u6d88\u606flinger.ms\u540e,\u751f\u4ea7\u8005\u5c31\u4f1a\u5c06\u6d88\u606f\u63d0\u4ea4\u7ed9kafka
-# linger.ms\u4e3a0\u8868\u793a\u6bcf\u63a5\u6536\u5230\u4e00\u6761\u6d88\u606f\u5c31\u63d0\u4ea4\u7ed9kafka,\u8fd9\u65f6\u5019batch-size\u5176\u5b9e\u5c31\u6ca1\u7528\u4e86
-
-# \u751f\u4ea7\u7aef\u7f13\u51b2\u533a\u5927\u5c0f
-spring.kafka.producer.buffer-memory = 33554432
-# Kafka\u63d0\u4f9b\u7684\u5e8f\u5217\u5316\u548c\u53cd\u5e8f\u5217\u5316\u7c7b
-spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
-spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
-# \u81ea\u5b9a\u4e49\u5206\u533a\u5668
-# spring.kafka.producer.properties.partitioner.class=com.felix.kafka.producer.CustomizePartitioner
-
-############################################################################
-#Management endpoints configuration                                        #
-############################################################################
-#management.server.port=9522
-#management.server.servlet.context-path=/maxkey-mgt-actuate
-#management.endpoints.enabled-by-default=false
-management.security.enabled=false
-#management.endpoints.jmx.exposure.include=health,info
-management.endpoints.web.exposure.include=metrics,health,info,env,beans
-
-############################################################################
-#domain name configuration                                                 #
-############################################################################
-maxkey.server.scheme=http
-maxkey.server.basedomain=maxkey.top
-maxkey.server.domain=sso.${maxkey.server.basedomain}
-maxkey.server.name=${maxkey.server.scheme}://${maxkey.server.domain}
-maxkey.server.uri=${maxkey.server.name}:9527/maxkey-mgt
-#default.uri
-maxkey.server.default.uri=${maxkey.server.uri}/main
-maxkey.maxkey.uri=https://${maxkey.server.domain}/maxkey
-#InMemory 0 , Redis 2 
-maxkey.server.persistence=0
-#identity
-maxkey.identity.kafkasupport=false
-
-############################################################################
-#Login configuration                                                       #
-############################################################################
-#enable captcha
-maxkey.login.captcha=true
-#text or arithmetic
-maxkey.login.captcha.type=text
-#enable two factor,use one time password
-maxkey.login.mfa=false
-#enable social sign on
-maxkey.login.socialsignon=false
-#Enable kerberos/SPNEGO
-maxkey.login.kerberos=false
-#wsFederation
-maxkey.login.wsfederation=false
-#remeberme
-maxkey.login.remeberme=false
-#validity
-maxkey.login.remeberme.validity=0
-#default.uri
-#to appList page
-maxkey.login.default.uri=appList
-#ipaddress whitelist
-maxkey.ipaddress.whitelist=false
-
-#############################################################################
-#SAML V2.0 configuration                                                    #
-#############################################################################
-#			saml common
-maxkey.saml.v20.max.parser.pool.size=2
-maxkey.saml.v20.assertion.validity.time.ins.seconds=90
-maxkey.saml.v20.replay.cache.life.in.millis=14400000
-maxkey.saml.v20.issue.instant.check.clock.skew.in.seconds=90
-maxkey.saml.v20.issue.instant.check.validity.time.in.seconds=300
-#saml idp keystore
-maxkey.saml.v20.idp.keystore.password=maxkey
-maxkey.saml.v20.idp.keystore.private.key.password=maxkey
-maxkey.saml.v20.idp.keystore=classpath\:config/samlServerKeystore.jks
-#keystore id for sec
-maxkey.saml.v20.idp.issuing.entity.id=maxkey.top
-maxkey.saml.v20.idp.issuer=https://sso.maxkey.top/maxkey/saml
-maxkey.saml.v20.idp.receiver.endpoint=https\://sso.maxkey.top/
-#saml sp keystore
-maxkey.saml.v20.sp.keystore.password=maxkey
-maxkey.saml.v20.sp.keystore.private.key.password=maxkey
-maxkey.saml.v20.sp.keystore=classpath\:config/samlClientKeystore.jks
-maxkey.saml.v20.sp.issuing.entity.id=client.maxkey.org
-
-#############################################################################
-#OIDC V1.0 METADATA configuration                                           #
-#############################################################################
-maxkey.oidc.metadata.issuer=https://${maxkey.server.domain}/maxkey
-maxkey.oidc.metadata.authorizationEndpoint=${maxkey.server.name}/maxkey/authz/oauth/v20/authorize
-maxkey.oidc.metadata.tokenEndpoint=${maxkey.server.name}/maxkey/authz/oauth/v20/token
-maxkey.oidc.metadata.userinfoEndpoint=${maxkey.server.name}/maxkey/api/connect/userinfo
-
-#############################################################################
-#Job Scheduler                                                              #
-#############################################################################
-#one hour for refresh dynamic groups  
-maxkey.job.cron.dynamicgroups=0 0 0/1 * * ?
-
+spring.profiles.active=http