StackOverflowError in spring oauth2 with custom ClientDetailsService
I made my own implementation of ClientDetailsService: @Service public class JpaClientDetailsService implements ClientDetailsService { @Autowired private ClientRepository clientRepositoy; @Override public ClientDetails loadClientByClientId(String clientId) throws ClientRegistrationException { ClientDetails client = clientRepositoy.findOne(clientId); if (client == null) { throw new ClientRegistrationException(String.format("Client with id %s not found", clientId)); } return client; } } ClientRepository is a standard JpaRepository. I configured an AuthorizationServerConfigurerAdapter like this: