Skip to content

Instantly share code, notes, and snippets.

@arvindkgs
Created July 31, 2021 11:44
Show Gist options
  • Save arvindkgs/df9b6dd989fe28db623b459c02a895a2 to your computer and use it in GitHub Desktop.
Save arvindkgs/df9b6dd989fe28db623b459c02a895a2 to your computer and use it in GitHub Desktop.
[spring-security] Spring security
@Configuration
public class ApplicationSecurity extends WebSecurityConfigurerAdapter {

    @Override
    public void configure(WebSecurity web) throws Exception {
        web
           .ignoring()
               .antMatchers("/**");
    }
}

OR

@Bean
    public SecurityWebFilterChain chain(ServerHttpSecurity http, AuthenticationWebFilter webFilter) {
        return http.authorizeExchange().anyExchange().permitAll().and()
                .csrf().disable()
                .build();
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment