cleanup and upgrade

This commit is contained in:
DOHA
2016-01-20 20:54:42 -06:00
committed by David Morley
parent 3d564b081e
commit d8a8c1c135
18 changed files with 202 additions and 115 deletions
+2 -2
View File
@@ -19,9 +19,9 @@
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="owner.project.facets" value="java"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
+8 -12
View File
@@ -171,33 +171,29 @@
</build>
<properties>
<java-version>1.7</java-version>
<java-version>1.8</java-version>
<!-- Spring -->
<org.springframework.version>4.1.5.RELEASE</org.springframework.version>
<org.springframework.security.version>3.2.5.RELEASE</org.springframework.security.version>
<org.springframework.version>4.2.4.RELEASE</org.springframework.version>
<org.springframework.security.version>4.0.3.RELEASE</org.springframework.security.version>
<org.aspectj-version>1.8.1</org.aspectj-version>
<javax.servlet.jsp-api.version>2.3.2-b01</javax.servlet.jsp-api.version>
<!-- Spring -->
<org.springframework.version>4.1.5.RELEASE</org.springframework.version>
<org.springframework.security.version>3.2.5.RELEASE</org.springframework.security.version>
<!-- persistence -->
<hibernate.version>4.3.10.Final</hibernate.version>
<mysql-connector-java.version>5.1.35</mysql-connector-java.version>
<spring-data-jpa.version>1.7.2.RELEASE</spring-data-jpa.version>
<hibernate.version>4.3.11.Final</hibernate.version>
<mysql-connector-java.version>5.1.37</mysql-connector-java.version>
<spring-data-jpa.version>1.9.2.RELEASE</spring-data-jpa.version>
<!-- marshalling -->
<jackson.version>2.5.5</jackson.version>
<jackson.version>2.6.4</jackson.version>
<!-- logging -->
<org.slf4j.version>1.7.13</org.slf4j.version>
<logback.version>1.1.3</logback.version>
<!-- various -->
<hibernate-validator.version>5.1.3.Final</hibernate-validator.version>
<hibernate-validator.version>5.2.2.Final</hibernate-validator.version>
<!-- util -->
<guava.version>19.0</guava.version>
@@ -2,10 +2,10 @@
<beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"
http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd"
>
<http use-expressions="true">
<intercept-url pattern="/login*" access="permitAll"/>
@@ -21,7 +21,7 @@
<form-login login-page='/login.html' authentication-failure-url="/login.html?error=true" authentication-success-handler-ref="myAuthenticationSuccessHandler"
default-target-url="home.html"/>
<session-management invalid-session-url="/invalidSession.html" session-fixation-protection="none"/>
<logout invalidate-session="false" logout-success-url="/logout.html?logSucc=true" logout-url="/j_spring_security_logout" delete-cookies="JSESSIONID"/>
<logout invalidate-session="false" logout-success-url="/logout.html?logSucc=true" delete-cookies="JSESSIONID"/>
</http>
@@ -41,15 +41,15 @@
<body>
<h1><spring:message code="label.form.loginTitle"></spring:message></h1>
<form name='f' action="j_spring_security_check" method='POST' onsubmit="return validate();">
<form name='f' action="login" method='POST' onsubmit="return validate();">
<table>
<tr>
<td><label><spring:message code="label.form.loginEmail"></spring:message></label></td>
<td><input type='text' name='j_username' value=''></td>
<td><input type='text' name='username' value=''></td>
</tr>
<tr>
<td><label><spring:message code="label.form.loginPass"></spring:message></label></td>
<td><input type='password' name='j_password' /></td>
<td><input type='password' name='password' /></td>
</tr>
<tr>
<td><input name="submit" type="submit" value=<spring:message code="label.form.submit"></spring:message> /></td>
@@ -23,7 +23,7 @@
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
File diff suppressed because it is too large Load Diff
@@ -15,7 +15,7 @@ import org.springframework.security.web.authentication.SimpleUrlAuthenticationFa
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.LocaleResolver;
@Component
@Component("authenticationFailureHandler")
public class CustomAuthenticationFailureHandler extends SimpleUrlAuthenticationFailureHandler {
@Autowired
@@ -35,7 +35,7 @@ public class MvcConfig extends WebMvcConfigurerAdapter {
@Override
public void addViewControllers(final ViewControllerRegistry registry) {
super.addViewControllers(registry);
registry.addViewController("/login.html");
registry.addViewController("/login");
registry.addViewController("/registration.html");
registry.addViewController("/logout.html");
registry.addViewController("/homepage.html");
@@ -51,7 +51,7 @@ public class SecSecurityConfig extends WebSecurityConfigurerAdapter {
http
.csrf().disable()
.authorizeRequests()
.antMatchers("/j_spring_security_check*","/login*", "/logout*", "/signin/**", "/signup/**",
.antMatchers("/login*","/login*", "/logout*", "/signin/**", "/signup/**",
"/user/registration*", "/regitrationConfirm*", "/expiredAccount*", "/registration*",
"/badUser*", "/user/resendRegistrationToken*" ,"/forgetPassword*", "/user/resetPassword*",
"/user/changePassword*", "/emailError*", "/resources/**","/old/user/registration*","/successRegister*").permitAll()
@@ -59,14 +59,11 @@ public class SecSecurityConfig extends WebSecurityConfigurerAdapter {
.anyRequest().authenticated()
.and()
.formLogin()
.loginPage("/login.html")
.loginProcessingUrl("/j_spring_security_check")
.loginPage("/login")
.defaultSuccessUrl("/homepage.html")
.failureUrl("/login.html?error=true")
.failureUrl("/login?error=true")
.successHandler(myAuthenticationSuccessHandler)
.failureHandler(authenticationFailureHandler)
.usernameParameter("j_username")
.passwordParameter("j_password")
.permitAll()
.and()
.sessionManagement()
@@ -75,7 +72,6 @@ public class SecSecurityConfig extends WebSecurityConfigurerAdapter {
.and()
.logout()
.invalidateHttpSession(false)
.logoutUrl("/j_spring_security_logout")
.logoutSuccessUrl("/logout.html?logSucc=true")
.deleteCookies("JSESSIONID")
.permitAll();
@@ -2,7 +2,7 @@
<beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd
http://www.springframework.org/schema/security/spring-security-4.0.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd"
>
@@ -28,10 +28,17 @@
<intercept-url pattern="/resources/**" access="permitAll"/>
<intercept-url pattern="/invalidSession*" access="isAnonymous()"/>
<intercept-url pattern="/**" access="isAuthenticated()"/>
<form-login login-page='/login.html' authentication-failure-url="/login.html?error=true" authentication-success-handler-ref="myAuthenticationSuccessHandler"
default-target-url="/homepage.html"/>
<session-management invalid-session-url="/invalidSession.html" session-fixation-protection="none"/>
<logout invalidate-session="false" logout-success-url="/logout.html?logSucc=true" logout-url="/j_spring_security_logout" delete-cookies="JSESSIONID"/>
<csrf disabled="true"/>
<form-login login-page='/login'
authentication-success-handler-ref="myAuthenticationSuccessHandler"
authentication-failure-handler-ref="authenticationFailureHandler"
default-target-url="/homepage"/>
<session-management invalid-session-url="/invalidSession" session-fixation-protection="none"/>
<logout invalidate-session="false" logout-success-url="/logoutPage?logSucc=true" delete-cookies="JSESSIONID"/>
</http>
<authentication-manager>
@@ -15,7 +15,7 @@
<a class="navbar-brand"href="<c:url value="/home.html" />"><spring:message code="label.pages.home.title"></spring:message></a>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a href="<c:url value="/j_spring_security_logout" />"><spring:message code="label.pages.logout"></spring:message></a> </li>
<li><a href="<c:url value="/logout" />"><spring:message code="label.pages.logout"></spring:message></a> </li>
</ul>
</div>
</nav>
@@ -17,7 +17,7 @@
<a class="navbar-brand"href="#"><spring:message code="label.pages.home.title"></spring:message></a>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a href="<c:url value="/j_spring_security_logout" />"><spring:message code="label.pages.logout"></spring:message></a> </li>
<li><a href="<c:url value="/logout" />"><spring:message code="label.pages.logout"></spring:message></a> </li>
</ul>
</div>
</nav>
@@ -13,7 +13,7 @@
<a class="navbar-brand"href="<c:url value="/home.html" />"><spring:message code="label.pages.home.title"></spring:message></a>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a href="<c:url value="/j_spring_security_logout" />"><spring:message code="label.pages.logout"></spring:message></a> </li>
<li><a href="<c:url value="/logout" />"><spring:message code="label.pages.logout"></spring:message></a> </li>
</ul>
</div>
</nav>
@@ -14,7 +14,7 @@
<a class="navbar-brand"href="#"><spring:message code="label.pages.home.title"></spring:message></a>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a href="<c:url value="/j_spring_security_logout" />"><spring:message code="label.pages.logout"></spring:message></a> </li>
<li><a href="<c:url value="/logout" />"><spring:message code="label.pages.logout"></spring:message></a> </li>
</ul>
</div>
</nav>
@@ -15,7 +15,7 @@
<a class="navbar-brand"href="<c:url value="/home.html" />"><spring:message code="label.pages.home.title"></spring:message></a>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a href="<c:url value="/j_spring_security_logout" />"><spring:message code="label.pages.logout"></spring:message></a> </li>
<li><a href="<c:url value="/logout" />"><spring:message code="label.pages.logout"></spring:message></a> </li>
</ul>
</div>
</nav>
@@ -58,18 +58,17 @@ ${SPRING_SECURITY_LAST_EXCEPTION}
<spring:message code="label.form.loginTitle"></spring:message>
</h1>
<a href="?lang=en"><spring:message code="label.form.loginEnglish"></spring:message></a>
| <a href="?lang=es_ES"><spring:message
code="label.form.loginSpanish"></spring:message></a>
| <a href="?lang=es_ES"><spring:message code="label.form.loginSpanish"></spring:message></a>
<br><br>
<form name='f' action="j_spring_security_check" method='POST'
onsubmit="return validate();">
<form name='f' action="login" method='POST' onsubmit="return validate();">
<label class="col-sm-4"><spring:message code="label.form.loginEmail"></spring:message></label>
<span class="col-sm-8"><input class="form-control" type='text' name='j_username' value=''></span>
<span class="col-sm-8"><input class="form-control" type='text' name='username' value=''></span>
<br><br>
<label class="col-sm-4"><spring:message code="label.form.loginPass"></spring:message></label>
<span class="col-sm-8"><input class="form-control" type='password' name='j_password' /></span>
<span class="col-sm-8"><input class="form-control" type='password' name='password' /></span>
<br><br>
<input class="btn btn-primary" name="submit" type="submit"
@@ -23,7 +23,7 @@
<spring:message code="message.logoutSucc"></spring:message>
</h1>
</c:if>
<a class="btn btn-primary" href="<c:url value="login.html" />"><spring:message
<a class="btn btn-primary" href="<c:url value="login" />"><spring:message
code="label.form.loginLink"></spring:message></a>
</div>
</body>
@@ -38,7 +38,7 @@ public class ChangePasswordLiveTest {
@Autowired
private PasswordEncoder passwordEncoder;
private final FormAuthConfig formConfig = new FormAuthConfig(URL_PREFIX + "/j_spring_security_check", "j_username", "j_password");
private final FormAuthConfig formConfig = new FormAuthConfig(URL_PREFIX + "/login", "username", "password");
@Before
public void init() {