hantsy/angular-spring-reactive-sample

Spring Security error

Closed this issue · 6 comments

On startup with security
error of
Parameter 0 of method springWebFilterChain in com.example.ThreeSquare.SecurityConfig required a bean of type 'org.springframework.security.config.web.server.ServerHttpSecurity' that could not be found.

if added @EnableWebFluxSecurity

The bean 'requestDataValueProcessor', defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebMvcSecurityConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/security/config/annotation/web/reactive/WebFluxSecurityConfiguration.class] and overriding is disabled.

Could not make it run at all...

@EnableWebFluxSecurity could disable the auto-configuration of Spring Security, please check the documentation of Spring Boot for details.

If you want to customize Security manually, try to extend WebSecurityConfigurerAdapter

@Configuration
@EnableWebSecurity
public class SecurityConfiguration  extends WebSecurityConfigurerAdapter{
    @Override
    protected void configure(HttpSecurity http) throws Exception{
        http.authorizeRequests().antMatchers("/").permitAll();
    }
}

I tried clone your project understand how spring work but it wont run

Parameter 0 of method springWebFilterChain in com.example.ThreeSquare.SecurityConfig required a bean of type 'org.springframework.security.config.web.server.ServerHttpSecurity' that could not be found.

Please follow the readme to build and run the application.

I followed every step and re tried it twice already still the same error

You should run a Redis at the same time. I just confirmed in my local system, it worked well as expected.

I have updated the README.

Perfectly Working