cleanup and upgrade

This commit is contained in:
DOHA
2016-01-05 19:55:11 +02:00
parent 4a029959af
commit 6b10b326a2
10 changed files with 42 additions and 76 deletions

View File

@@ -35,19 +35,16 @@ public class SecurityJavaConfig extends WebSecurityConfigurerAdapter {
}
@Override
protected void configure(final HttpSecurity http) throws Exception { // @formatter:off
protected void configure(final HttpSecurity http) throws Exception {// @formatter:off
http
.csrf().disable()
.exceptionHandling()
.authenticationEntryPoint(restAuthenticationEntryPoint)
.and()
.authorizeRequests()
.antMatchers("/api/foos").authenticated()
.antMatchers("/api/**").authenticated()
.and()
.formLogin()
.loginProcessingUrl("/j_spring_security_check")
.usernameParameter("j_username")
.passwordParameter("j_password")
.successHandler(authenticationSuccessHandler)
.failureHandler(new SimpleUrlAuthenticationFailureHandler())
.and()