org.springframework.social.oauth2
Class ProtectedResourceClientFactory

java.lang.Object
  extended by org.springframework.social.oauth2.ProtectedResourceClientFactory

public class ProtectedResourceClientFactory
extends java.lang.Object

Factory for RestTemplate instances that execute requests for resources protected by the OAuth 2 protocol. Encapsulates the configuration of the interceptor that adds the necessary Authorization header to each request before it is executed. Also hides the differences between Spring 3.0.x and 3.1 implementation.


Constructor Summary
ProtectedResourceClientFactory()
           
 
Method Summary
static RestTemplate draft10(java.lang.String accessToken)
          Constructs a RestTemplate that adds the Authorization header using the style described in the draft 10 of the OAuth2 specification: http://tools.ietf.org/html/draft-ietf-oauth-v2-10#section-5.1.1
static RestTemplate draft8(java.lang.String accessToken)
          Constructs a RestTemplate that adds the Authorization header using the style described in the draft 8 of the OAuth2 specification: http://tools.ietf.org/html/draft-ietf-oauth-v2-08#section-5.1
static RestTemplate standard(java.lang.String accessToken)
          Constructs a RestTemplate that adds the Authorization header using the bearer token style described in the latest draft (draft 12) of the OAuth2 specification: http://tools.ietf.org/html/draft-ietf-oauth-v2-12#section-7.1
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtectedResourceClientFactory

public ProtectedResourceClientFactory()
Method Detail

standard

public static RestTemplate standard(java.lang.String accessToken)
Constructs a RestTemplate that adds the Authorization header using the bearer token style described in the latest draft (draft 12) of the OAuth2 specification: http://tools.ietf.org/html/draft-ietf-oauth-v2-12#section-7.1

Parameters:
accessToken - the access token

draft10

public static RestTemplate draft10(java.lang.String accessToken)
Constructs a RestTemplate that adds the Authorization header using the style described in the draft 10 of the OAuth2 specification: http://tools.ietf.org/html/draft-ietf-oauth-v2-10#section-5.1.1

Parameters:
accessToken - the access token

draft8

public static RestTemplate draft8(java.lang.String accessToken)
Constructs a RestTemplate that adds the Authorization header using the style described in the draft 8 of the OAuth2 specification: http://tools.ietf.org/html/draft-ietf-oauth-v2-08#section-5.1

Parameters:
accessToken - the access token