Effective & Secure Method to populate Access Token for authorization header in Rest Template
You can have an interceptor on RestTemplate. It will be called for each request. You can have the access token logic within the interceptor. You can also implementing caching so that you do not fire two requests for each task. In case the token expires (401 response), you can regenerate the token

@Component
class MyInterceptor implements ClientHttpRequestInterceptor {
   @Override
    public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution){
      HttpHeaders headers = request.getHeaders();
      headers.setBearerAuth(someCachedService.getBearerToken());
      ... response = execution.execute(request, body);
     // handle unauthorized request

   }
}

@Bean
RestTemplate restTemplate(MyInterceptor interceptor){
  RestTemplate restTemplate = new RestTemplate();
  restTemplate.setInterceptors(Arrays.asList(interceptor));
}