我正在开发一个带有 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)