gregwhitaker / springboot-webflux-apikey-example

Example of authenticating with a Spring Boot WebFlux application using an API key.
GNU Affero General Public License v3.0
12 stars 5 forks source link

Bean of type 'org.springframework.security.config.annotation.web.builders.HttpSecurity' that could not be found? #1

Open Manfred73 opened 2 years ago

Manfred73 commented 2 years ago

Great example on how to do security with apikey and webflux. I have followed your example, but then using maven, using dependencies spring-boot-starter-webflux and spring-boot-starter-security. However, when I run the application, I get the following error message:

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method managementSecurityFilterChain in org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration required a bean of type 'org.springframework.security.config.annotation.web.builders.HttpSecurity' that could not be found.

Action:

Consider defining a bean of type 'org.springframework.security.config.annotation.web.builders.HttpSecurity' in your configuration.

What am I missing here?

Manfred73 commented 2 years ago

Seems the ManagementWebSecurityAutoConfiguration is triggered because I also have spring-boot-starter-actuator as a dependency on the classpath.