cleanup and upgrade
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
<http use-expressions="true" entry-point-ref="restAuthenticationEntryPoint">
|
||||
<intercept-url pattern="/api/**" access="isAuthenticated()"/>
|
||||
|
||||
<sec:form-login authentication-success-handler-ref="mySuccessHandler" authentication-failure-handler-ref="myFailureHandler"/>
|
||||
<csrf disabled="true"/>
|
||||
|
||||
<form-login authentication-success-handler-ref="mySuccessHandler" authentication-failure-handler-ref="myFailureHandler"/>
|
||||
|
||||
<logout/>
|
||||
</http>
|
||||
|
||||
Reference in New Issue
Block a user