title: RestTemplate does not follow redirects even when GET is used
body: <p>I am using the RestTemplate class to get to some page, which will require redirect ( redirect to oauth 2 provider, but that probably doesnt matter ).</p>
  <p>I am doing:</p>
  <pre><code>ResponseEntity&lt;String&gt; forEntity = oAuth2RestTemplate.getForEntity(url, String.class, Collections.emptyMap());
  </code></pre>
  <p>with standard <code>OAuth2RestTemplate</code>, I haven't done any custom creation of this bean, so it is just injected from Spring.</p>
  <p>As a response I get a <code>ResponseEntity</code> with <code>location</code> header and 302 status, but it is not followed. Judging by many other sources RestTemplate should follow redirects by default if all I do is <code>GET</code> - similar issue here: <a href="https://stackoverflow.com/questions/29418583/follow-302-redirect-using-spring-resttemplate">Follow 302 redirect using Spring restTemplate?</a></p>
  <p>This is not a case, no redirect happens, am I missing something? Do I have to manually grab this <code>location</code>  and redirect to it manually?</p>
  <p><strong>update:</strong></p>
  <p>OK, OAuth2RestTemplate is using OAuth2AccessTokenSupport as a request factory. This class configures factory to <strong>NOT</strong> follow redirects. Too bad it is so hard to find.</p>
  <p>But using <code>= new RestTemplate()</code> doesnt help either ( note new keyword, if you are going to autowire it, then Spring will autowire oauth2RestTemplate ).</p>