Carlos Venegas
Jul 27, 2017 · 1 min read

Hey man, you are missing the ‘@Primary’ annotation in the SecurityConfig class. I am getting the following error:

Method springSecurityFilterChain in org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration required a single bean, but 3 were found:

- consumerTokenServices: defined by method ‘consumerTokenServices’ in class path resource [org/springframework/security/oauth2/config/annotation/web/configuration/AuthorizationServerEndpointsConfiguration.class]

- defaultAuthorizationServerTokenServices: defined by method ‘defaultAuthorizationServerTokenServices’ in class path resource [org/springframework/security/oauth2/config/annotation/web/configuration/AuthorizationServerEndpointsConfiguration.class]

- tokenServices: defined by method ‘tokenServices’ in class path resource [org/ocupatucalle/resource/config/SecurityConfig.class]

    Carlos Venegas

    Written by