相关疑难解决方法(0)

无法找到 'org.springframework.security.oauth2.client.registration.ClientRegistrationRepository' 类型的 Bean。- 春季安全

我正在开发一个带有 spring-security 的 spring 应用程序并使用 google 登录,但在执行应用程序时出现此错误:

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

Description:

Method springSecurityFilterChain in org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration required a bean of type 'org.springframework.security.oauth2.client.registration.ClientRegistrationRepository' that could not be found.

The following candidates were found but could not be injected:
    - Bean method 'clientRegistrationRepository' in 'OAuth2ClientRegistrationRepositoryConfiguration' not loaded because OAuth2 Clients Configured Condition registered clients is not available


Action:

Consider revisiting the entries above or defining a bean of type 'org.springframework.security.oauth2.client.registration.ClientRegistrationRepository' in your configuration.
Run Code Online (Sandbox Code Playgroud)

我的应用程序.yml:

spring:
    datasource:
        url: jdbc:mysql://localhost:3306/manager
        username: application_spring …
Run Code Online (Sandbox Code Playgroud)

java spring oauth-2.0 google-oauth spring-boot

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

google-oauth ×1

java ×1

oauth-2.0 ×1

spring ×1

spring-boot ×1