@Bean WebFilter springSecurityFilterChain(ReactiveAuthenticationManager manager) throws Exception { HttpSecurity http = http(); http.authenticationManager(manager); http.httpBasic(); http.authorizeRequests() .matchers(antMatchers("/admin/**")).hasRole("ADMIN") .matchers(antMatchers("/inventory/**")).hasRole("ADMIN") .matchers(antMatchers("/buy")).hasRole("USER") .matchers(anyExchange()).authenticated(); return http.build(); }
@Bean WebFilter springSecurityFilterChain(ReactiveAuthenticationManager manager) throws Exception { HttpSecurity http = http(); // FIXME use BeanPostProcessor to set the manager http.authenticationManager(manager); http.httpBasic(); AuthorizeRequestBuilder authorize = http.authorizeRequests(); authorize.antMatchers("/admin/**").hasRole("ADMIN"); authorize.anyExchange().authenticated(); return http.build(); }
public void setAuthenticationManager(ReactiveAuthenticationManager authenticationManager) { this.authenticationManager = authenticationManager; }
public HttpSecurity authenticationManager(ReactiveAuthenticationManager manager) { this.authenticationManager = manager; return this; }
@Bean WebFilter springSecurityFilterChain(ReactiveAuthenticationManager manager) throws Exception { HttpSecurity http = http(); http.authenticationManager(manager); http.httpBasic(); return http.build(); }
@Bean public ReactiveAuthenticationManager authenticationManager(UserRepositoryUserDetailsRepository udr) { return new UserDetailsAuthenticationManager(udr); }
@Bean public ReactiveAuthenticationManager authenticationManager() { return authentication -> null; }