Skip to content

Instantly share code, notes, and snippets.

@dherges
Last active December 1, 2016 08:24
Show Gist options
  • Save dherges/cdec0cf7ed9deb51148d14d6188a21ad to your computer and use it in GitHub Desktop.
Save dherges/cdec0cf7ed9deb51148d14d6188a21ad to your computer and use it in GitHub Desktop.
spring-csrf-cookie-to-header-token
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.csrf()
.csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse())
.and()
// other web security config follows ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment