Skip to content
Permalink
Browse files
Making spring security stateless.
  • Loading branch information
mifosio-04-04-2018 committed May 2, 2017
1 parent b3f3132 commit a398b2a99ca50af1b33c876aab6fd03f6713b05a
Showing 1 changed file with 3 additions and 1 deletion.
@@ -35,6 +35,7 @@
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.configurers.UrlAuthorizationConfigurer;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;

@@ -107,6 +108,7 @@ protected void configure(final HttpSecurity http) throws Exception {
.formLogin().disable()
.logout().disable()
.addFilter(filter)
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
.exceptionHandling().accessDeniedHandler(
(request, response, accessDeniedException) -> response.setStatus(HttpStatus.SC_NOT_FOUND));
}
@@ -118,4 +120,4 @@ public void configureGlobal(
throws Exception {
auth.authenticationProvider(provider);
}
}
}

0 comments on commit a398b2a

Please sign in to comment.