@ Override public ClientHttpResponse intercept ( HttpRequest req , byte [ ] body , ClientHttpRequestExecution execution ) throws IOException { Assert . notNull ( propertyResolver ) ; Assert . notNull ( id ) ; try { String authString = getOAuthAuthString ( req ) ; req . getHeaders ( ) . add ( Headers . Authorization . name ( ) , authString ) ; } catch ( Exception e ) { throw new IOException ( "Error building OAuth header" , e ) ; } return execution . execute ( req , body ) ; }
Intercept a request and add the oauth headers .