Interface OAuthConsumer

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractOAuthConsumer, CommonsHttpOAuthConsumer, DefaultOAuthConsumer

public interface OAuthConsumer extends Serializable

Exposes a simple interface to sign HTTP requests using a given OAuth token and secret. Refer to OAuthProvider how to retrieve a valid token and token secret.

HTTP messages are signed as follows:

 // exchange the arguments with the actual token/secret pair
 OAuthConsumer consumer = new DefaultOAuthConsumer("1234", "5678");
 
 URL url = new URL("http://example.com/protected.xml");
 HttpURLConnection request = (HttpURLConnection) url.openConnection();
 
 consumer.sign(request);
 
 request.connect();