Skip to content

Instantly share code, notes, and snippets.

@sandipchitale
Last active August 16, 2023 07:16
Show Gist options
  • Save sandipchitale/4258bfea742c1518276000373a6517b5 to your computer and use it in GitHub Desktop.
Save sandipchitale/4258bfea742c1518276000373a6517b5 to your computer and use it in GitHub Desktop.
Ignore resource #spring-security
@Bean
public WebSecurityCustomizer webSecurityCustomizer() {
return (web) -> web.ignoring()
.requestMatchers(
// To avoid wrapping in MvcMatcher make sure to use AntPathRequestMatcher
AntPathRequestMatcher.antMatcher("/index.html"),
AntPathRequestMatcher.antMatcher("/**/*.css")
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment