Spring Cloud Gateway error on TokenRelayGatewayFilterFactory

Viewed 661

I'm getting the following error when running my Spring Cloud Gateway. The corresponding yml file and my dependencies are given below

    Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-04-04 18:28:56.698 ERROR 6944 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

Parameter 0 of method tokenRelayGatewayFilterFactory in org.springframework.cloud.security.oauth2.gateway.TokenRelayAutoConfiguration required a bean of type 'org.springframework.security.oauth2.client.web.server.ServerOAuth2AuthorizedClientRepository' that could not be found.

The following candidates were found but could not be injected:
    - Bean method 'authorizedClientRepository' in 'ReactiveOAuth2ClientConfigurations.ReactiveOAuth2ClientConfiguration' not loaded because @ConditionalOnBean (types: org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository; SearchStrategy: all) did not find any beans of type org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository


Action:

Consider revisiting the entries above or defining a bean of type 'org.springframework.security.oauth2.client.web.server.ServerOAuth2AuthorizedClientRepository' in your configuration.


Process finished with exit code 0

Dependencies:

   <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-gateway</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-oauth2-client</artifactId>
        <version>2.2.6.RELEASE</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-security -->
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-security</artifactId>
        <version>1.0.0.RELEASE</version>
    </dependency>

The yml that I'm trying to use is given below. I use OAuth2.0 and therefore I have a tokenrelay

>    application:
>     name: gateway   cloud:
>     gateway:
>       routes:
>         - id: jobpostingModule
>           uri: http://localhost:6084/
>           predicates:
>             - Path=/api/jobpostings/**
>           filters:
>             - TokenRelay=
>           sensitiveHeaders:
0 Answers
Related