Example usage for org.springframework.security.oauth2.client OAuth2RestTemplate setInterceptors

List of usage examples for org.springframework.security.oauth2.client OAuth2RestTemplate setInterceptors

Introduction

In this page you can find the example usage for org.springframework.security.oauth2.client OAuth2RestTemplate setInterceptors.

Prototype

public void setInterceptors(List<ClientHttpRequestInterceptor> interceptors) 

Source Link

Document

Set the request interceptors that this accessor should use.

Usage

From source file:com.feedeo.rest.client.AbstractOAuth2RestClient.java

@Override
protected RestOperations createRestOperations(ObjectMapper objectMapper,
        ClientHttpRequestFactory clientHttpRequestFactory) {
    RestTemplate restTemplate = (RestTemplate) super.createRestOperations(objectMapper,
            clientHttpRequestFactory);/*w  ww  .  j a  v  a 2s . c  o  m*/

    OAuth2RestTemplate oAuth2RestTemplate = new OAuth2RestTemplate(new BaseOAuth2ProtectedResourceDetails(),
            new DefaultOAuth2ClientContext());
    oAuth2RestTemplate.setRequestFactory(restTemplate.getRequestFactory());
    oAuth2RestTemplate.setMessageConverters(restTemplate.getMessageConverters());
    oAuth2RestTemplate.setInterceptors(restTemplate.getInterceptors());

    return oAuth2RestTemplate;
}