diff --git a/maxkey-core/src/main/java/org/maxkey/config/LoginConfig.java b/maxkey-core/src/main/java/org/maxkey/config/LoginConfig.java index d1292488facc4a3cbc7700d5a5e650bfe4497f87..035b32770bafe5ddc9fdf7b584fb27e148e8b9f0 100644 --- a/maxkey-core/src/main/java/org/maxkey/config/LoginConfig.java +++ b/maxkey-core/src/main/java/org/maxkey/config/LoginConfig.java @@ -5,94 +5,90 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; @Configuration -@PropertySource("classpath:/config/applicationLogin.properties") +@PropertySource("classpath:/config/applicationConfig.properties") public class LoginConfig { - @Value("${config.login.captcha}") - boolean captcha; - @Value("${config.login.onetimepwd}") - boolean oneTimePwd; - @Value("${config.login.socialsignon}") - boolean socialSignOn; - @Value("${config.login.kerberos}") - boolean kerberos; - @Value("${config.login.remeberme}") - boolean remeberMe; - @Value("${config.login.wsfederation}") - boolean wsFederation; - @Value("${config.login.default.uri}") - String defaultUri; - - - /** - * - */ - public LoginConfig() { - // TODO Auto-generated constructor stub - } - - public boolean isCaptcha() { - return captcha; - } - - public void setCaptcha(boolean captcha) { - this.captcha = captcha; - } - - - - public boolean isOneTimePwd() { - return oneTimePwd; - } - - public void setOneTimePwd(boolean oneTimePwd) { - this.oneTimePwd = oneTimePwd; - } - - public boolean isSocialSignOn() { - return socialSignOn; - } - - public void setSocialSignOn(boolean socialSignOn) { - this.socialSignOn = socialSignOn; - } - - public boolean isKerberos() { - return kerberos; - } - - public void setKerberos(boolean kerberos) { - this.kerberos = kerberos; - } - - public String getDefaultUri() { - return defaultUri; - } - - public void setDefaultUri(String defaultUri) { - this.defaultUri = defaultUri; - } - - public boolean isRemeberMe() { - return remeberMe; - } - - public void setRemeberMe(boolean remeberMe) { - this.remeberMe = remeberMe; - } - - public boolean isWsFederation() { - return wsFederation; - } - - public void setWsFederation(boolean wsFederation) { - this.wsFederation = wsFederation; - } - - @Override - public String toString() { - return "LoginConfig [captcha=" + captcha + ", oneTimePwd=" + oneTimePwd - + ", socialSignOn=" + socialSignOn + ", kerberos=" + kerberos - + ", remeberMe=" + remeberMe + ", wsFederation=" + wsFederation - + ", defaultUri=" + defaultUri + "]"; - } + @Value("${config.login.captcha}") + boolean captcha; + @Value("${config.login.onetimepwd}") + boolean oneTimePwd; + @Value("${config.login.socialsignon}") + boolean socialSignOn; + @Value("${config.login.kerberos}") + boolean kerberos; + @Value("${config.login.remeberme}") + boolean remeberMe; + @Value("${config.login.wsfederation}") + boolean wsFederation; + @Value("${config.login.default.uri}") + String defaultUri; + + /** + * . + */ + public LoginConfig() { + // TODO Auto-generated constructor stub + } + + public boolean isCaptcha() { + return captcha; + } + + public void setCaptcha(boolean captcha) { + this.captcha = captcha; + } + + public boolean isOneTimePwd() { + return oneTimePwd; + } + + public void setOneTimePwd(boolean oneTimePwd) { + this.oneTimePwd = oneTimePwd; + } + + public boolean isSocialSignOn() { + return socialSignOn; + } + + public void setSocialSignOn(boolean socialSignOn) { + this.socialSignOn = socialSignOn; + } + + public boolean isKerberos() { + return kerberos; + } + + public void setKerberos(boolean kerberos) { + this.kerberos = kerberos; + } + + public String getDefaultUri() { + return defaultUri; + } + + public void setDefaultUri(String defaultUri) { + this.defaultUri = defaultUri; + } + + public boolean isRemeberMe() { + return remeberMe; + } + + public void setRemeberMe(boolean remeberMe) { + this.remeberMe = remeberMe; + } + + public boolean isWsFederation() { + return wsFederation; + } + + public void setWsFederation(boolean wsFederation) { + this.wsFederation = wsFederation; + } + + @Override + public String toString() { + return "LoginConfig [captcha=" + captcha + ", oneTimePwd=" + oneTimePwd + ", socialSignOn=" + socialSignOn + + ", kerberos=" + kerberos + ", remeberMe=" + remeberMe + ", wsFederation=" + wsFederation + + ", defaultUri=" + defaultUri + "]"; + } } diff --git a/maxkey-core/src/main/java/org/maxkey/web/InitApplicationContext.java b/maxkey-core/src/main/java/org/maxkey/web/InitApplicationContext.java index 29206971ee72642e293c298ca1bc7ce05ec9d941..42c1171c6525a23d26b4c7ecf96ecf64899c97a1 100644 --- a/maxkey-core/src/main/java/org/maxkey/web/InitApplicationContext.java +++ b/maxkey-core/src/main/java/org/maxkey/web/InitApplicationContext.java @@ -32,144 +32,154 @@ import org.springframework.web.context.support.WebApplicationContextUtils; */ public class InitApplicationContext extends HttpServlet { private static final Logger _logger = LoggerFactory.getLogger(InitApplicationContext.class); - - ApplicationContext applicationContext; - - /** - * - */ - private static final long serialVersionUID = -797399138268601444L; - - @Override - public String getServletInfo() { - return super.getServletInfo(); - } - - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - - //List Environment Variables - listEnvVars(); - - listProperties(); - - //List DatabaseMetaData Variables - listDataBaseVariables(); - - //load caches - loadCaches(); - - //Show License - showLicense(); - } - - /** - * + private static final long serialVersionUID = -797399138268601444L; + ApplicationContext applicationContext; + Properties properties; + + @Override + public String getServletInfo() { + return super.getServletInfo(); + } + + @Override + public void init(ServletConfig config) throws ServletException { + super.init(config); + + // List Environment Variables + listEnvVars(); + + listProperties(); + + // List DatabaseMetaData Variables + listDataBaseVariables(); + + // load caches + loadCaches(); + + // Show License + showLicense(); + } + + /** + * InitApplicationContext. */ - public InitApplicationContext() { - this.applicationContext=WebApplicationContextUtils.getWebApplicationContext(this.getServletContext()); - } - - public InitApplicationContext(ConfigurableApplicationContext applicationContext) { - this.applicationContext=applicationContext; - } - - public void loadCaches(){ - _logger.info("----------------------------------------------------------------------------------------------------"); - _logger.info("Load Caches "); - - try { - if(applicationContext.containsBean("cacheFactory")){ - CacheFactory cacheFactory=applicationContext.getBean("cacheFactory", CacheFactory.class); - cacheFactory.start(); - } - } catch (BeansException e) { - e.printStackTrace(); - } - _logger.info("----------------------------------------------------------------------------------------------------"); - - } - public void listDataBaseVariables(){ - if(applicationContext.containsBean("dataSource")){ - try { - _logger.debug("----------------------------------------------------------------------------------------------------"); - _logger.debug("List DatabaseMetaData Variables "); - Connection connection = ((javax.sql.DataSource)applicationContext.getBean("dataSource")).getConnection(); - - java.sql.DatabaseMetaData databaseMetaData = connection.getMetaData(); - _logger.debug("DatabaseProductName : " + databaseMetaData.getDatabaseProductName()); - _logger.debug("DatabaseProductVersion: " + databaseMetaData.getDatabaseProductVersion()); - _logger.debug("DatabaseMajorVersion : " + databaseMetaData.getDatabaseMajorVersion()); - _logger.debug("DatabaseMinorVersion : " + databaseMetaData.getDatabaseMinorVersion()); - _logger.debug("supportsTransactions : " + databaseMetaData.supportsTransactions()); - _logger.debug("DefaultTransaction : " + databaseMetaData.getDefaultTransactionIsolation()); - _logger.debug("MaxConnections : " + databaseMetaData.getMaxConnections()); - _logger.debug(""); - _logger.debug("JDBCMajorVersion : " + databaseMetaData.getJDBCMajorVersion()); - _logger.debug("JDBCMinorVersion : " + databaseMetaData.getJDBCMinorVersion()); - _logger.debug("DriverName : " + databaseMetaData.getDriverName()); - _logger.debug("DriverVersion : " + databaseMetaData.getDriverVersion()); - _logger.debug(""); - _logger.debug("DBMS URL : " + databaseMetaData.getURL()); - _logger.debug("UserName : " + databaseMetaData.getUserName()); - _logger.debug("----------------------------------------------------------------------------------------------------"); - } catch (SQLException e) { - e.printStackTrace(); - } - } - } - - //propertySourcesPlaceholderConfigurer - public void listProperties(){ - if(applicationContext.containsBean("propertySourcesPlaceholderConfigurer")){ - _logger.debug("----------------------------------------------------------------------------------------------------"); - _logger.debug("List Properties Variables "); - PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = ((PropertySourcesPlaceholderConfigurer)applicationContext.getBean("propertySourcesPlaceholderConfigurer")); - Properties properties=(Properties)propertySourcesPlaceholderConfigurer.getAppliedPropertySources().get(PropertySourcesPlaceholderConfigurer.LOCAL_PROPERTIES_PROPERTY_SOURCE_NAME).getSource(); - Set keyValue = properties.keySet(); - SortedSet keyValueSet=new TreeSet(); - //sort key - for (Iterator it = keyValue.iterator(); it.hasNext();){ - String key = (String) it.next(); - keyValueSet.add(key); - } - //out - for (Iterator it = keyValueSet.iterator(); it.hasNext();){ - String key = (String) it.next(); - _logger.debug(key + " = " + properties.get(key)); - } - _logger.debug("----------------------------------------------------------------------------------------------------"); - } - } - - public void listEnvVars() { - _logger.debug("----------------------------------------------------------------------------------------------------"); - _logger.debug("List Environment Variables "); - Map map = System.getenv(); - SortedSet keyValueSet = new TreeSet(); - for (Iterator itr = map.keySet().iterator(); itr.hasNext();) { - String key = itr.next(); - keyValueSet.add(key); - } - // out - for (Iterator it = keyValueSet.iterator(); it.hasNext();) { - String key = (String) it.next(); - _logger.debug(key + " = " + map.get(key)); - } - _logger.debug("APP_HOME" + " = " + PathUtils.getInstance().getAppPath()); - _logger.debug("----------------------------------------------------------------------------------------------------"); - } - - public void showLicense(){ - _logger.info("----------------------------------------------------------------------------------------------------"); - _logger.info("+ Single Sign On ( SSO ) "); - _logger.info("+ MaxKey Version v1.3 GA"); - _logger.info(""); - _logger.info("+ Apache License 2.0"); - _logger.info("+ https://github.com/shimingxy/MaxKey"); - _logger.info("+ email:shimingxy@163.com"); - _logger.info("----------------------------------------------------------------------------------------------------"); - } + public InitApplicationContext() { + this.applicationContext = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext()); + } + + public InitApplicationContext(ConfigurableApplicationContext applicationContext) { + this.applicationContext = applicationContext; + } + + public void loadCaches() { + _logger.info( + "----------------------------------------------------------------------------------------------------"); + _logger.info("Load Caches "); + + try { + if (applicationContext.containsBean("cacheFactory")) { + CacheFactory cacheFactory = applicationContext.getBean("cacheFactory", CacheFactory.class); + cacheFactory.start(); + } + } catch (BeansException e) { + e.printStackTrace(); + } + _logger.info( + "----------------------------------------------------------------------------------------------------"); + + } + + public void listDataBaseVariables() { + if (applicationContext.containsBean("dataSource")) { + try { + _logger.debug( + "----------------------------------------------------------------------------------------------------"); + _logger.debug("List DatabaseMetaData Variables "); + Connection connection = ((javax.sql.DataSource) applicationContext.getBean("dataSource")) + .getConnection(); + + java.sql.DatabaseMetaData databaseMetaData = connection.getMetaData(); + _logger.debug("DatabaseProductName : " + databaseMetaData.getDatabaseProductName()); + _logger.debug("DatabaseProductVersion: " + databaseMetaData.getDatabaseProductVersion()); + _logger.debug("DatabaseMajorVersion : " + databaseMetaData.getDatabaseMajorVersion()); + _logger.debug("DatabaseMinorVersion : " + databaseMetaData.getDatabaseMinorVersion()); + _logger.debug("supportsTransactions : " + databaseMetaData.supportsTransactions()); + _logger.debug("DefaultTransaction : " + databaseMetaData.getDefaultTransactionIsolation()); + _logger.debug("MaxConnections : " + databaseMetaData.getMaxConnections()); + _logger.debug(""); + _logger.debug("JDBCMajorVersion : " + databaseMetaData.getJDBCMajorVersion()); + _logger.debug("JDBCMinorVersion : " + databaseMetaData.getJDBCMinorVersion()); + _logger.debug("DriverName : " + databaseMetaData.getDriverName()); + _logger.debug("DriverVersion : " + databaseMetaData.getDriverVersion()); + _logger.debug(""); + _logger.debug("DBMS URL : " + databaseMetaData.getURL()); + _logger.debug("UserName : " + databaseMetaData.getUserName()); + _logger.debug( + "----------------------------------------------------------------------------------------------------"); + } catch (SQLException e) { + e.printStackTrace(); + } + } + } + + // propertySourcesPlaceholderConfigurer + public void listProperties() { + if (applicationContext.containsBean("propertySourcesPlaceholderConfigurer")) { + _logger.debug( + "----------------------------------------------------------------------------------------------------"); + _logger.debug("List Properties Variables "); + PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = ((PropertySourcesPlaceholderConfigurer) applicationContext + .getBean("propertySourcesPlaceholderConfigurer")); + properties = (Properties) propertySourcesPlaceholderConfigurer.getAppliedPropertySources() + .get(PropertySourcesPlaceholderConfigurer.LOCAL_PROPERTIES_PROPERTY_SOURCE_NAME).getSource(); + Set keyValue = properties.keySet(); + SortedSet keyValueSet = new TreeSet(); + // sort key + for (Iterator it = keyValue.iterator(); it.hasNext();) { + String key = (String) it.next(); + keyValueSet.add(key); + } + // out + for (Iterator it = keyValueSet.iterator(); it.hasNext();) { + String key = (String) it.next(); + _logger.debug(key + " = " + properties.get(key)); + } + _logger.debug( + "----------------------------------------------------------------------------------------------------"); + } + } + + public void listEnvVars() { + _logger.debug( + "----------------------------------------------------------------------------------------------------"); + _logger.debug("List Environment Variables "); + Map map = System.getenv(); + SortedSet keyValueSet = new TreeSet(); + for (Iterator itr = map.keySet().iterator(); itr.hasNext();) { + String key = itr.next(); + keyValueSet.add(key); + } + // out + for (Iterator it = keyValueSet.iterator(); it.hasNext();) { + String key = (String) it.next(); + _logger.debug(key + " = " + map.get(key)); + } + _logger.debug("APP_HOME" + " = " + PathUtils.getInstance().getAppPath()); + _logger.debug( + "----------------------------------------------------------------------------------------------------"); + } + + public void showLicense() { + _logger.info( + "----------------------------------------------------------------------------------------------------"); + _logger.info("+ Single Sign On ( SSO ) "); + _logger.info("+ MaxKey Version "+properties.getProperty("application.formatted-version")); + _logger.info(""); + _logger.info("+ Apache License 2.0"); + _logger.info("+ https://shimingxy.github.io/MaxKey/"); + _logger.info("+ email:shimingxy@163.com"); + _logger.info( + "----------------------------------------------------------------------------------------------------"); + } } diff --git a/maxkey-web-manage/src/main/resources/config/applicationConfig.properties b/maxkey-web-manage/src/main/resources/config/applicationConfig.properties index 3e256fbc152853c6c0e0d737facb18da15b3e860..93accc6e04b9aa21fb9bc3d68e1ab0f17b250e66 100644 --- a/maxkey-web-manage/src/main/resources/config/applicationConfig.properties +++ b/maxkey-web-manage/src/main/resources/config/applicationConfig.properties @@ -63,7 +63,27 @@ config.email.smtpHost=smtp.exmail.qq.com config.email.port=25 config.email.senderMail=test@maxkey.org config.email.ssl=false +############################################################################ +# Login configuration +#enable captcha +config.login.captcha=true +#enable two factor,use one time password +config.login.onetimepwd=true +#enable social sign on +config.login.socialsignon=true +#Enable kerberos/SPNEGO +config.login.kerberos=true +#wsFederation +config.login.wsfederation=false +#remeberme +config.login.remeberme=true +#validity +config.login.remeberme.validity= +#default.uri +#to appList page +config.login.default.uri=appList +config.ipaddress.whitelist=false ############################################################################ # SAML V2.0 configuration # saml common diff --git a/maxkey-web-manage/src/main/resources/config/applicationLogin.properties b/maxkey-web-manage/src/main/resources/config/applicationLogin.properties deleted file mode 100644 index 8ac34f5f93e7431a2e0567b9d88d65897064f7e1..0000000000000000000000000000000000000000 --- a/maxkey-web-manage/src/main/resources/config/applicationLogin.properties +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################ -# MaxKey -############################################################################ -# Login configuration -#enable captcha -config.login.captcha=true -#enable two factor,use one time password -config.login.onetimepwd=true -#enable social sign on -config.login.socialsignon=true -#Enable kerberos/SPNEGO -config.login.kerberos=true -#wsFederation -config.login.wsfederation=false -#remeberme -config.login.remeberme=true -#validity -config.login.remeberme.validity= -#default.uri -#to appList page -config.login.default.uri=appList - -config.ipaddress.whitelist=false diff --git a/maxkey-web-manage/src/main/resources/spring/maxkey-mgt.xml b/maxkey-web-manage/src/main/resources/spring/maxkey-mgt.xml index 8478e4cc2d282816aa5648025a2aa3df00c71e6b..83d53f039a7dd0ea25544e2173ce5594fbe43c30 100644 --- a/maxkey-web-manage/src/main/resources/spring/maxkey-mgt.xml +++ b/maxkey-web-manage/src/main/resources/spring/maxkey-mgt.xml @@ -26,9 +26,8 @@ - classpath:config/applicationConfig.properties - classpath:config/applicationLogin.properties - + classpath:config/applicationConfig.properties + classpath:application.properties diff --git a/maxkey-web-maxkey/src/main/resources/config/applicationConfig.properties b/maxkey-web-maxkey/src/main/resources/config/applicationConfig.properties index 88f62820b604303051bd9337c842bec128a50d14..ad00fdc14d94a45c9d47f91485ae2fc39a6a54ab 100644 --- a/maxkey-web-maxkey/src/main/resources/config/applicationConfig.properties +++ b/maxkey-web-maxkey/src/main/resources/config/applicationConfig.properties @@ -76,4 +76,179 @@ config.redis.port=6379 #password config.redis.password=password -config.redis.timeout=10000 \ No newline at end of file +config.redis.timeout=10000 + +############################################################################ +# Login configuration +#enable captcha +config.login.captcha=true +#enable two factor,use one time password +config.login.onetimepwd=true +#enable social sign on +config.login.socialsignon=true +#Enable kerberos/SPNEGO +config.login.kerberos=true +#wsFederation +config.login.wsfederation=false +#remeberme +config.login.remeberme=true +#validity +config.login.remeberme.validity= + +#to default application web site +config.login.default.uri=appList + +config.ipaddress.whitelist=false +############################################################################ +# Kerberos Login configuration +############################################################################ +#short name of user domain must be in upper case,eg:MAXKEY +config.support.kerberos.default.userdomain=MAXKEY +#short name of user domain must be in upper case,eg:MAXKEY.ORG +config.support.kerberos.default.fulluserdomain=MAXKEY.ORG +#last 8Bit crypto for Kerberos web Authentication +config.support.kerberos.default.crypto=846KZSzYq56M6d5o +#Kerberos Authentication server RUL +config.support.kerberos.default.redirecturi=http://sso.maxkey.org/kerberos/authn/ +############################################################################ +# HTTPHEADER Login configuration +############################################################################ + +config.support.httpheader.enable=false + +config.support.httpheader.headername=header-user + +# iv-user is for IBM Security Access Manager +#config.httpheader.headername=iv-user + +############################################################################ +# BASIC Login support configuration +############################################################################ + +config.support.basic.enable=false + +############################################################################# +# WsFederation Login support configuration +#identifier: the identifer for the ADFS server +#url: the login url for ADFS +#principal: the name of the attribute/assertion returned by ADFS that contains the principal's username. +#relyingParty: the identifier of the CAS Server as it has been configured in ADFS. +#tolerance: (optional) the amount of drift to allow when validating the timestamp on the token. Default: 10000 (ms) +#attributeMutator: (optional) a class (defined by you) that can modify the attributes/assertions returned by the ADFS server +#signingCertificate: ADFS's signing certificate used to validate the token/assertions issued by ADFS. +############################################################################ + +config.support.wsfederation.identifier=http://adfs.maxkey.org/adfs/services/trust +config.support.wsfederation.url=https://adfs.maxkey.org/adfs/ls/ +config.support.wsfederation.principal=upn +config.support.wsfederation.relyingParty=urn:federation:connsec +config.support.wsfederation.signingCertificate=adfs-signing.crt +config.support.wsfederation.tolerance=10000 +config.support.wsfederation.upn.suffix=maxkey.org +config.support.wsfederation.logoutUrl=https://adfs.maxkey.org/adfs/ls/?wa=wsignout1.0 +############################################################################# + +############################################################################# +config.oidc.metadata.issuer=${config.server.name}/maxkey +config.oidc.metadata.authorizationEndpoint=${config.server.name}/maxkey/oauth/v20/authorize +config.oidc.metadata.tokenEndpoint=${config.server.name}/maxkey/oauth/v20/token +config.oidc.metadata.userinfoEndpoint=${config.server.name}/maxkey/api/connect/userinfo +############################################################################# + + +############################################################################ +# Social Sign On Configuration # +#you config client.id & client.secret only +############################################################################ + +############################################################################ +#sina weibo +config.socialsignon.sinaweibo.provider=sinaweibo +config.socialsignon.sinaweibo.provider.name=\u65B0\u6D6A\u5FAE\u535A +config.socialsignon.sinaweibo.icon=images/social/sinaweibo.png +config.socialsignon.sinaweibo.client.id=3379757634 +config.socialsignon.sinaweibo.client.secret=1adfdf9800299037bcab9d1c238664ba +config.socialsignon.sinaweibo.account.id=id +config.socialsignon.sinaweibo.sortorder=1 + +#Google +config.socialsignon.google.provider=google +config.socialsignon.google.provider.name=Google +config.socialsignon.google.icon=images/social/google.png +config.socialsignon.google.client.id=519914515488.apps.googleusercontent.com +config.socialsignon.google.client.secret=3aTW3Iw7e11QqMnHxciCaXTt +config.socialsignon.google.account.id=id +config.socialsignon.google.sortorder=2 + +#QQ +config.socialsignon.qq.provider=qq +config.socialsignon.qq.provider.name=QQ +config.socialsignon.qq.icon=images/social/qq.png +config.socialsignon.qq.client.id=101225363 +config.socialsignon.qq.client.secret=8577d75e0eb4a91ac549cc8be3371bfd +config.socialsignon.qq.account.id=openid +config.socialsignon.qq.sortorder=4 + +#dingtalk +config.socialsignon.dingtalk.provider=dingtalk +config.socialsignon.dingtalk.provider.name=dingtalk +config.socialsignon.dingtalk.icon=images/social/dingtalk.png +config.socialsignon.dingtalk.client.id=dingoawf2jyiwh2uzqnphg +config.socialsignon.dingtalk.client.secret=Crm7YJbMKfRlvG2i1SHpg4GHVpqF_oXiEjhmRQyiSiuzNRWpbFh9i0UjDTfhOoN9 +config.socialsignon.dingtalk.account.id=openid +config.socialsignon.dingtalk.sortorder=5 + +#Microsoft +config.socialsignon.microsoft.provider=microsoft +config.socialsignon.microsoft.provider.name=Microsoft +config.socialsignon.microsoft.icon=images/social/live.png +config.socialsignon.microsoft.client.id=24aa73b6-7928-4e64-bd64-d8682e650f95 +config.socialsignon.microsoft.client.secret=PF[_AthtjVrtWVO2mNy@CJxY1@Z8FNf5 +config.socialsignon.microsoft.account.id=id +config.socialsignon.microsoft.sortorder=6 + +#facebook +config.socialsignon.facebook.provider=facebook +config.socialsignon.facebook.provider.name=facebook +config.socialsignon.facebook.icon=images/social/facebook.png +config.socialsignon.facebook.client.id=appKey +config.socialsignon.facebook.client.secret=appSecret +config.socialsignon.facebook.account.id=id +config.socialsignon.facebook.sortorder=7 + +############################################################################ +# SAML V2.0 configuration +#saml common +config.saml.v20.max.parser.pool.size=2 +config.saml.v20.assertion.validity.time.ins.seconds=90 +config.saml.v20.replay.cache.life.in.millis=14400000 +config.saml.v20.issue.instant.check.clock.skew.in.seconds=90 +config.saml.v20.issue.instant.check.validity.time.in.seconds=300 + + +#saml idp keystore +config.saml.v20.idp.keystore.password=maxkey +config.saml.v20.idp.keystore.private.key.password=maxkey +config.saml.v20.idp.keystore=classpath\:config/samlServerKeystore.jks +#keystore id for sec +config.saml.v20.idp.issuing.entity.id=maxkey.org +config.saml.v20.idp.issuer=https://sso.maxkey.org/maxkey/saml + +config.saml.v20.idp.receiver.endpoint=https\://sso.maxkey.org/ + +#saml sp keystore +config.saml.v20.sp.keystore.password=maxkey +config.saml.v20.sp.keystore.private.key.password=maxkey +config.saml.v20.sp.keystore=classpath\:config/samlClientKeystore.jks +config.saml.v20.sp.issuing.entity.id=client.maxkey.org + +#Saml v20 Metadata +config.saml.v20.metadata.orgName=maxkey +config.saml.v20.metadata.orgDisplayName=maxkey +config.saml.v20.metadata.orgURL=https://github.com/shimingxy/MaxKey +config.saml.v20.metadata.contactType=technical +config.saml.v20.metadata.company=maxkey +config.saml.v20.metadata.givenName=maxkey +config.saml.v20.metadata.surName=maxkey +config.saml.v20.metadata.emailAddress=shimingxy@163.com +config.saml.v20.metadata.telephoneNumber=4008981111 \ No newline at end of file diff --git a/maxkey-web-maxkey/src/main/resources/config/applicationLogin.properties b/maxkey-web-maxkey/src/main/resources/config/applicationLogin.properties deleted file mode 100644 index b0708cdb7219c8e3b0c0d34053bf82880facda6e..0000000000000000000000000000000000000000 --- a/maxkey-web-maxkey/src/main/resources/config/applicationLogin.properties +++ /dev/null @@ -1,139 +0,0 @@ -############################################################################ -# MaxKey -############################################################################ -# Login configuration -#enable captcha -config.login.captcha=true -#enable two factor,use one time password -config.login.onetimepwd=true -#enable social sign on -config.login.socialsignon=true -#Enable kerberos/SPNEGO -config.login.kerberos=true -#wsFederation -config.login.wsfederation=false -#remeberme -config.login.remeberme=true -#validity -config.login.remeberme.validity= - -#to default application web site -config.login.default.uri=appList - -config.ipaddress.whitelist=false -############################################################################ -# Kerberos Login configuration -############################################################################ -#short name of user domain must be in upper case,eg:MAXKEY -config.support.kerberos.default.userdomain=MAXKEY -#short name of user domain must be in upper case,eg:MAXKEY.ORG -config.support.kerberos.default.fulluserdomain=MAXKEY.ORG -#last 8Bit crypto for Kerberos web Authentication -config.support.kerberos.default.crypto=846KZSzYq56M6d5o -#Kerberos Authentication server RUL -config.support.kerberos.default.redirecturi=http://sso.maxkey.org/kerberos/authn/ -############################################################################ -# HTTPHEADER Login configuration -############################################################################ - -config.support.httpheader.enable=false - -config.support.httpheader.headername=header-user - -# iv-user is for IBM Security Access Manager -#config.httpheader.headername=iv-user - -############################################################################ -# BASIC Login support configuration -############################################################################ - -config.support.basic.enable=false - -############################################################################# -# WsFederation Login support configuration -#identifier: the identifer for the ADFS server -#url: the login url for ADFS -#principal: the name of the attribute/assertion returned by ADFS that contains the principal's username. -#relyingParty: the identifier of the CAS Server as it has been configured in ADFS. -#tolerance: (optional) the amount of drift to allow when validating the timestamp on the token. Default: 10000 (ms) -#attributeMutator: (optional) a class (defined by you) that can modify the attributes/assertions returned by the ADFS server -#signingCertificate: ADFS's signing certificate used to validate the token/assertions issued by ADFS. -############################################################################ - -config.support.wsfederation.identifier=http://adfs.maxkey.org/adfs/services/trust -config.support.wsfederation.url=https://adfs.maxkey.org/adfs/ls/ -config.support.wsfederation.principal=upn -config.support.wsfederation.relyingParty=urn:federation:connsec -config.support.wsfederation.signingCertificate=adfs-signing.crt -config.support.wsfederation.tolerance=10000 -config.support.wsfederation.upn.suffix=maxkey.org -config.support.wsfederation.logoutUrl=https://adfs.maxkey.org/adfs/ls/?wa=wsignout1.0 -############################################################################# - -############################################################################# -config.oidc.metadata.issuer=${config.server.name}/maxkey -config.oidc.metadata.authorizationEndpoint=${config.server.name}/maxkey/oauth/v20/authorize -config.oidc.metadata.tokenEndpoint=${config.server.name}/maxkey/oauth/v20/token -config.oidc.metadata.userinfoEndpoint=${config.server.name}/maxkey/api/connect/userinfo -############################################################################# - - -############################################################################ -# Social Sign On Configuration # -#you config client.id & client.secret only -############################################################################ - -############################################################################ -#sina weibo -config.socialsignon.sinaweibo.provider=sinaweibo -config.socialsignon.sinaweibo.provider.name=\u65B0\u6D6A\u5FAE\u535A -config.socialsignon.sinaweibo.icon=images/social/sinaweibo.png -config.socialsignon.sinaweibo.client.id=3379757634 -config.socialsignon.sinaweibo.client.secret=1adfdf9800299037bcab9d1c238664ba -config.socialsignon.sinaweibo.account.id=id -config.socialsignon.sinaweibo.sortorder=1 - -#Google -config.socialsignon.google.provider=google -config.socialsignon.google.provider.name=Google -config.socialsignon.google.icon=images/social/google.png -config.socialsignon.google.client.id=519914515488.apps.googleusercontent.com -config.socialsignon.google.client.secret=3aTW3Iw7e11QqMnHxciCaXTt -config.socialsignon.google.account.id=id -config.socialsignon.google.sortorder=2 - -#QQ -config.socialsignon.qq.provider=qq -config.socialsignon.qq.provider.name=QQ -config.socialsignon.qq.icon=images/social/qq.png -config.socialsignon.qq.client.id=101225363 -config.socialsignon.qq.client.secret=8577d75e0eb4a91ac549cc8be3371bfd -config.socialsignon.qq.account.id=openid -config.socialsignon.qq.sortorder=4 - -#dingtalk -config.socialsignon.dingtalk.provider=dingtalk -config.socialsignon.dingtalk.provider.name=dingtalk -config.socialsignon.dingtalk.icon=images/social/dingtalk.png -config.socialsignon.dingtalk.client.id=dingoawf2jyiwh2uzqnphg -config.socialsignon.dingtalk.client.secret=Crm7YJbMKfRlvG2i1SHpg4GHVpqF_oXiEjhmRQyiSiuzNRWpbFh9i0UjDTfhOoN9 -config.socialsignon.dingtalk.account.id=openid -config.socialsignon.dingtalk.sortorder=5 - -#Microsoft -config.socialsignon.microsoft.provider=microsoft -config.socialsignon.microsoft.provider.name=Microsoft -config.socialsignon.microsoft.icon=images/social/live.png -config.socialsignon.microsoft.client.id=24aa73b6-7928-4e64-bd64-d8682e650f95 -config.socialsignon.microsoft.client.secret=PF[_AthtjVrtWVO2mNy@CJxY1@Z8FNf5 -config.socialsignon.microsoft.account.id=id -config.socialsignon.microsoft.sortorder=6 - -#facebook -config.socialsignon.facebook.provider=facebook -config.socialsignon.facebook.provider.name=facebook -config.socialsignon.facebook.icon=images/social/facebook.png -config.socialsignon.facebook.client.id=appKey -config.socialsignon.facebook.client.secret=appSecret -config.socialsignon.facebook.account.id=id -config.socialsignon.facebook.sortorder=7 \ No newline at end of file diff --git a/maxkey-web-maxkey/src/main/resources/config/applicationSaml.properties b/maxkey-web-maxkey/src/main/resources/config/applicationSaml.properties deleted file mode 100644 index ecd11b69f4b28520a2d08ab16dd84e1cc521047d..0000000000000000000000000000000000000000 --- a/maxkey-web-maxkey/src/main/resources/config/applicationSaml.properties +++ /dev/null @@ -1,38 +0,0 @@ -############################################################################ -# MaxKey -############################################################################ -# SAML V2.0 configuration -#saml common -config.saml.v20.max.parser.pool.size=2 -config.saml.v20.assertion.validity.time.ins.seconds=90 -config.saml.v20.replay.cache.life.in.millis=14400000 -config.saml.v20.issue.instant.check.clock.skew.in.seconds=90 -config.saml.v20.issue.instant.check.validity.time.in.seconds=300 - - -#saml idp keystore -config.saml.v20.idp.keystore.password=maxkey -config.saml.v20.idp.keystore.private.key.password=maxkey -config.saml.v20.idp.keystore=classpath\:config/samlServerKeystore.jks -#keystore id for sec -config.saml.v20.idp.issuing.entity.id=maxkey.org -config.saml.v20.idp.issuer=https://sso.maxkey.org/maxkey/saml - -config.saml.v20.idp.receiver.endpoint=https\://sso.maxkey.org/ - -#saml sp keystore -config.saml.v20.sp.keystore.password=maxkey -config.saml.v20.sp.keystore.private.key.password=maxkey -config.saml.v20.sp.keystore=classpath\:config/samlClientKeystore.jks -config.saml.v20.sp.issuing.entity.id=client.maxkey.org - -#Saml v20 Metadata -config.saml.v20.metadata.orgName=maxkey -config.saml.v20.metadata.orgDisplayName=maxkey -config.saml.v20.metadata.orgURL=https://github.com/shimingxy/MaxKey -config.saml.v20.metadata.contactType=technical -config.saml.v20.metadata.company=maxkey -config.saml.v20.metadata.givenName=maxkey -config.saml.v20.metadata.surName=maxkey -config.saml.v20.metadata.emailAddress=shimingxy@163.com -config.saml.v20.metadata.telephoneNumber=4008981111 \ No newline at end of file diff --git a/maxkey-web-maxkey/src/main/resources/spring/maxkey.xml b/maxkey-web-maxkey/src/main/resources/spring/maxkey.xml index 7f144207448278a7ba4968248ccc149114cb8f8f..b515e3737d63fbbd21153b2010492bf6d2fc1e4f 100644 --- a/maxkey-web-maxkey/src/main/resources/spring/maxkey.xml +++ b/maxkey-web-maxkey/src/main/resources/spring/maxkey.xml @@ -23,8 +23,7 @@ classpath:config/applicationConfig.properties - classpath:config/applicationLogin.properties - classpath:config/applicationSaml.properties + classpath:application.properties