@ Override public ClientHttpResponse intercept ( HttpRequest request , byte [ ] body , ClientHttpRequestExecution execution ) throws IOException { HttpRequestWrapper requestWrapper = new HttpRequestWrapper ( request ) ; HttpHeaders headers = requestWrapper . getHeaders ( ) ; headers . setBearerAuth ( getAccessToken ( ) . getTokenValue ( ) ) ; return execution . execute ( requestWrapper , body ) ; }
Add an OAuth2 bearer token header to each request .