Skip to content
Permalink
Browse files
Merge pull request #5 from myrle-krantz/develop
Making spring security stateless.
  • Loading branch information
myrle-krantz committed May 2, 2017
2 parents 4192aa8 + a398b2a commit 31b183a6fc49ab39afc6f41476a364610cc932a7
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 31b183a

Please sign in to comment.