我只是想在我的应用程序中启用谷歌登录功能,但遇到了这个特定的错误。我不理解这个问题为什么会出现?我需要帮助解决这个错误吗?有什么提示吗?
@Configuration
@EnableOAuth2Sso
public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.csrf()
.disable()
.antMatcher("/**")
.authorizeRequests()
.antMatchers("/", "/welcomepage")
.permitAll()
.anyRequest()
.authenticated();
}
}
***************************
APPLICATION FAILED TO START
***************************
Description:
The bean 'scopedTarget.oauth2ClientContext', defined in class path resource [org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2RestOperationsConfiguration$SessionScopedConfiguration$ClientContextConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/security/oauth2/config/annotation/web/configuration/OAuth2ClientConfiguration$OAuth2ClientContextConfiguration.class] and overriding is disabled.
Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
2.1.3.RELEASE
上仍然遇到这个问题,现在它只是说重复的两个都在OAuth2RestOperationsConfiguration.class
中,而不是一个在那里,另一个在其他地方。看起来它只是把问题转移了。 - user10677470