okta-spring-boot
okta-spring-boot copied to clipboard
Adding Spring HATEOAS to a project with Okta Boot Starter makes it fail to start
I'm submitting a
- [x] bug report
- [ ] feature request
Background info
If I have a project with the following dependencies:
dependencies {
implementation 'me.paulschwarz:spring-dotenv:4.0.0'
implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j'
implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
implementation 'com.okta.spring:okta-spring-boot-starter:3.0.5'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
It starts just fine if I have my OKTA_*
environment variables provided in an .env
file and mapped in application.properties
. However, once I had the following dependency (because I want to configure WebClient
to handle HATEOAS), it fails to start.
implementation 'org.springframework.boot:spring-boot-starter-hateoas'
The error is:
Description:
Parameter 0 of constructor in com.example.apigateway.config.SecurityConfiguration required a bean of type 'org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository' in your configuration.
> Task :boot run FAILED
If I remove the dependency, the app starts fine.
Expected behavior
I should be able to use Spring HATEOAS with the Okta Spring Boot starter.
Steps to reproduce
git clone https://github.com/oktadev/auth0-java-microservices-examples.git
cd auth0-java-microservices-examples/spring-boot-gateway-webflux
Then, follow the instructions in the README to configure Auth0 and watch it fail when it starts. Remove the spring-boot-starter-hateoas
dependency, and it starts just fine.
SDK Version
3.0.5