code: protected RestTemplate createRestTemplate() {
  		ClientHttpRequestFactory requestFactory = ClientHttpRequestFactorySelector.getRequestFactory();
  		RestTemplate restTemplate = new RestTemplate(requestFactory);
  		List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>(2);
  		converters.add(new FormHttpMessageConverter());
  		converters.add(new FormMapHttpMessageConverter());
  		converters.add(new MappingJackson2HttpMessageConverter());
  		restTemplate.setMessageConverters(converters);
  		restTemplate.setErrorHandler(new LoggingErrorHandler());
  		if (!useParametersForClientAuthentication) {
  			List<ClientHttpRequestInterceptor> interceptors = restTemplate.getInterceptors();
  			if (interceptors == null) {   // defensively initialize list if it is null. (See SOCIAL-430)
  				interceptors = new ArrayList<ClientHttpRequestInterceptor>();
  				restTemplate.setInterceptors(interceptors);
  			}
  			interceptors.add(new PreemptiveBasicAuthClientHttpRequestInterceptor(clientId, clientSecret));
  		}
  		return restTemplate;
  	}
docs: Creates the {@link RestTemplate} used to communicate with the provider's OAuth 2 API.
  This implementation creates a RestTemplate with a minimal set of HTTP message converters ({@link FormHttpMessageConverter} and {@link MappingJackson2HttpMessageConverter}).
  May be overridden to customize how the RestTemplate is created.
  For example, if the provider returns data in some format other than JSON for form-encoded, you might override to register an appropriate message converter.
  @return a {@link RestTemplate} used to communicate with the provider's OAuth 2 API