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

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

Introduction

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

Prototype

public void setAuthenticator(OAuth2RequestAuthenticator authenticator) 

Source Link

Document

Strategy for extracting an Authorization header from an access token and the request details.

Usage

From source file:com.feedeo.shopify.web.client.rest.ShopifyOAuth2RestClient.java

private static ShopifyOAuth2RestClient createSingleton() {
    Properties properties = getProperties();

    String clientId = getClientIdFromProperties(properties);
    String clientSecret = getClientSecretFromProperties(properties);

    ShopifyOAuth2RestClient client = new ShopifyOAuth2RestClient(clientId, clientSecret);

    OAuth2RestTemplate restOperations = (OAuth2RestTemplate) client.getRestOperations();
    restOperations.setAuthenticator(new ShopifyOAuth2RequestAuthenticator());

    return client;
}