Bmalhi:
Estoy tratando sencilla para permitir inicio de Google en función de mi aplicación, pero conseguir este error en particular. No entiendo este problema por eso que estoy recibiendo? Necesito ayuda para corregir este error? ¿Alguna pista?
@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
Philip Gran Polonia:
Me había encontrado con el mismo problema. Resolví que mediante la actualización de la versión de la biblioteca de spring-security-OAuth2-AUTOCONFIGURE a 2.1.1.RELEASE.
<dependency>
<groupId>org.springframework.security.oauth.boot</groupId>
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
<version>2.1.1.RELEASE</version>
</dependency>