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 e287169e..17e998e0 100644 --- a/maxkey-core/src/main/java/org/maxkey/web/InitApplicationContext.java +++ b/maxkey-core/src/main/java/org/maxkey/web/InitApplicationContext.java @@ -93,27 +93,27 @@ public class InitApplicationContext extends HttpServlet { public void listDataBaseVariables(){ if(applicationContext.containsBean("dataSource")){ try { - _logger.info("----------------------------------------------------------------------------------------------------"); - _logger.info("List DatabaseMetaData Variables "); + _logger.debug("----------------------------------------------------------------------------------------------------"); + _logger.debug("List DatabaseMetaData Variables "); Connection connection = ((javax.sql.DataSource)applicationContext.getBean("dataSource")).getConnection(); java.sql.DatabaseMetaData databaseMetaData = connection.getMetaData(); - _logger.info("DatabaseProductName : " + databaseMetaData.getDatabaseProductName()); - _logger.info("DatabaseProductVersion: " + databaseMetaData.getDatabaseProductVersion()); - _logger.info("DatabaseMajorVersion : " + databaseMetaData.getDatabaseMajorVersion()); - _logger.info("DatabaseMinorVersion : " + databaseMetaData.getDatabaseMinorVersion()); - _logger.info("supportsTransactions : " + databaseMetaData.supportsTransactions()); - _logger.info("DefaultTransaction : " + databaseMetaData.getDefaultTransactionIsolation()); - _logger.info("MaxConnections : " + databaseMetaData.getMaxConnections()); - _logger.info(""); - _logger.info("JDBCMajorVersion : " + databaseMetaData.getJDBCMajorVersion()); - _logger.info("JDBCMinorVersion : " + databaseMetaData.getJDBCMinorVersion()); - _logger.info("DriverName : " + databaseMetaData.getDriverName()); - _logger.info("DriverVersion : " + databaseMetaData.getDriverVersion()); - _logger.info(""); - _logger.info("DBMS URL : " + databaseMetaData.getURL()); - _logger.info("UserName : " + databaseMetaData.getUserName()); - _logger.info("----------------------------------------------------------------------------------------------------"); + _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(); } @@ -123,8 +123,8 @@ public class InitApplicationContext extends HttpServlet { //propertySourcesPlaceholderConfigurer public void listProperties(){ if(applicationContext.containsBean("propertySourcesPlaceholderConfigurer")){ - _logger.info("----------------------------------------------------------------------------------------------------"); - _logger.info("List Properties Variables "); + _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(); @@ -137,15 +137,15 @@ public class InitApplicationContext extends HttpServlet { //out for (Iterator it = keyValueSet.iterator(); it.hasNext();){ String key = (String) it.next(); - _logger.info(key + " = " + properties.get(key)); + _logger.debug(key + " = " + properties.get(key)); } - _logger.info("----------------------------------------------------------------------------------------------------"); + _logger.debug("----------------------------------------------------------------------------------------------------"); } } public void listEnvVars() { - _logger.info("----------------------------------------------------------------------------------------------------"); - _logger.info("List Environment Variables "); + _logger.debug("----------------------------------------------------------------------------------------------------"); + _logger.debug("List Environment Variables "); Map map = System.getenv(); SortedSet keyValueSet = new TreeSet(); for (Iterator itr = map.keySet().iterator(); itr.hasNext();) { @@ -155,10 +155,10 @@ public class InitApplicationContext extends HttpServlet { // out for (Iterator it = keyValueSet.iterator(); it.hasNext();) { String key = (String) it.next(); - _logger.info(key + " = " + map.get(key)); + _logger.debug(key + " = " + map.get(key)); } - _logger.info("APP_HOME" + " = " + PathUtils.getInstance().getAppPath()); - _logger.info("----------------------------------------------------------------------------------------------------"); + _logger.debug("APP_HOME" + " = " + PathUtils.getInstance().getAppPath()); + _logger.debug("----------------------------------------------------------------------------------------------------"); } public void showLicense(){ diff --git a/maxkey-web-manage/src/main/java/org/maxkey/web/endpoint/LoginEndpoint.java b/maxkey-web-manage/src/main/java/org/maxkey/web/endpoint/LoginEndpoint.java index 78333754..f666af62 100644 --- a/maxkey-web-manage/src/main/java/org/maxkey/web/endpoint/LoginEndpoint.java +++ b/maxkey-web-manage/src/main/java/org/maxkey/web/endpoint/LoginEndpoint.java @@ -99,6 +99,9 @@ public class LoginEndpoint { }else { WebContext.setAttribute(WebConstants.SPRING_PROCESS_SAVED_REQUEST, firstSavedRequest); } + if(WebContext.isAuthenticated()){ + return WebContext.redirect("/main"); + } modelAndView.setViewName("login"); return modelAndView; } @@ -106,11 +109,10 @@ public class LoginEndpoint { @RequestMapping(value={"/logon.do"}) public ModelAndView logon(@ModelAttribute("authentication") BasicAuthentication authentication) { - authenticationProvider.authenticate(authentication); - if(WebContext.isAuthenticated()){ return WebContext.redirect("/main"); }else{ + authenticationProvider.authenticate(authentication); return WebContext.redirect("/login"); } } diff --git a/maxkey-web-manage/src/main/resources/config/applicationLogin.properties b/maxkey-web-manage/src/main/resources/config/applicationLogin.properties index 4e7acb3d..5620bcb2 100644 --- a/maxkey-web-manage/src/main/resources/config/applicationLogin.properties +++ b/maxkey-web-manage/src/main/resources/config/applicationLogin.properties @@ -91,7 +91,7 @@ config.support.wsfederation.logoutUrl=https://adfs.connsec.com/adfs/ls/?wa=wsign ############################################################################# ############################################################################# -config.oidc.metadata.issuer=${config.server.maxkey.uri} +config.oidc.metadata.issuer=${config.server.name}/maxkey config.oidc.metadata.authorizationEndpoint=${config.server.maxkey.uri}/oauth/v20/authorize config.oidc.metadata.tokenEndpoint=${config.server.maxkey.uri}/oauth/v20/token config.oidc.metadata.userinfoEndpoint=${config.server.maxkey.uri}/api/connect/userinfo diff --git a/maxkey-web-manage/src/main/resources/spring/maxkey-mgt-security.xml b/maxkey-web-manage/src/main/resources/spring/maxkey-mgt-security.xml index 2ade5d14..49ead5b8 100644 --- a/maxkey-web-manage/src/main/resources/spring/maxkey-mgt-security.xml +++ b/maxkey-web-manage/src/main/resources/spring/maxkey-mgt-security.xml @@ -38,15 +38,15 @@ - + - - + + @@ -105,8 +105,8 @@ - - + + diff --git a/maxkey-web-maxkey/src/main/resources/templates/views/layout/top.ftl b/maxkey-web-maxkey/src/main/resources/templates/views/layout/top.ftl index 9450ac15..d5469cc8 100644 --- a/maxkey-web-maxkey/src/main/resources/templates/views/layout/top.ftl +++ b/maxkey-web-maxkey/src/main/resources/templates/views/layout/top.ftl @@ -36,7 +36,7 @@ - +
  <@locale code="global.text.manage"/>  
diff --git a/maxkey-web-maxkey/src/main/resources/templates/views/passwordExpired.ftl b/maxkey-web-maxkey/src/main/resources/templates/views/passwordExpired.ftl index 72363114..e1ff793e 100644 --- a/maxkey-web-maxkey/src/main/resources/templates/views/passwordExpired.ftl +++ b/maxkey-web-maxkey/src/main/resources/templates/views/passwordExpired.ftl @@ -18,7 +18,7 @@
- +
@@ -26,37 +26,33 @@ diff --git a/maxkey-web-maxkey/src/main/resources/templates/views/passwordInitial.ftl b/maxkey-web-maxkey/src/main/resources/templates/views/passwordInitial.ftl index c8daba05..566c3865 100644 --- a/maxkey-web-maxkey/src/main/resources/templates/views/passwordInitial.ftl +++ b/maxkey-web-maxkey/src/main/resources/templates/views/passwordInitial.ftl @@ -18,7 +18,7 @@ -
<@locale code="login.password.expired.tip" />
<@locale code="userinfo.displayName" /> : - +
<@locale code="userinfo.username" /> : - +
<@locale code="login.password.newPassword" />: - - * - +
<@locale code="login.password.confirmPassword" />: - - * - +
- "/> + "/>
+
@@ -26,37 +26,33 @@
<@locale code="login.password.initial.change.tip" />
<@locale code="userinfo.displayName" /> : - +
<@locale code="userinfo.username" /> : - +
<@locale code="login.password.newPassword" />: - - * - +
<@locale code="login.password.confirmPassword" />: - - * - +
- "/> + "/>