Skip to content

Adding Spring HATEOAS to a project with Okta Boot Starter makes it fail to start #607

@mraible

Description

@mraible

I'm submitting a

  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions