public class GenericOAuth1ConnectionFactory extends OAuth1ConnectionFactory<RestOperations>
OAuth1ConnectionFactory
that carries no intrinsic knowledge of the API it will be creating connections against.
Instead, it must be configured with API provider-specific details.
This enables developers to use Spring Social to create connections against any API for which there isn't a ready-to-use connection support and API binding
without creating one-off connection factory and service provider implementations.
The API binding provided by this connection factory is simply a RestOperations
, but the underlying RestTemplate
is configured to automatically
add Authorization
headers to all requests.Constructor and Description |
---|
GenericOAuth1ConnectionFactory(String providerId,
String consumerKey,
String consumerSecret,
String requestTokenUrl,
String authorizeUrl,
String accessTokenUrl,
OAuth1Version oauth1Version,
ApiAdapter<RestOperations> apiAdapter)
Creates an instance of GenericOAuth1ConnectionFactory.
|
GenericOAuth1ConnectionFactory(String providerId,
String consumerKey,
String consumerSecret,
String requestTokenUrl,
String authorizeUrl,
String authenticateUrl,
String accessTokenUrl,
OAuth1Version oauth1Version,
ApiAdapter<RestOperations> apiAdapter)
Creates an instance of GenericOAuth1ConnectionFactory for a provider that offers a separate authentication URL.
|
createConnection, createConnection, extractProviderUserId, getOAuthOperations
getApiAdapter, getProviderId, getServiceProvider
public GenericOAuth1ConnectionFactory(String providerId, String consumerKey, String consumerSecret, String requestTokenUrl, String authorizeUrl, String accessTokenUrl, OAuth1Version oauth1Version, ApiAdapter<RestOperations> apiAdapter)
providerId
- Some String that acts as the unique ID for the API provider.consumerKey
- The application's consumer key for the API.consumerSecret
- The application's consumer secret for the API.requestTokenUrl
- The API's OAuth 1.0/1.0a request token URL.authorizeUrl
- The API's OAuth 1.0/1.0a authorization URL.accessTokenUrl
- The API's OAuth 1.0/1.0a access token URL.oauth1Version
- The version of OAuth 1 (OAuth 1.0 or OAuth 1.0a) supported by the provider.apiAdapter
- A custom implementation of ApiAdapter
used to fetch data when creating the connection.public GenericOAuth1ConnectionFactory(String providerId, String consumerKey, String consumerSecret, String requestTokenUrl, String authorizeUrl, String authenticateUrl, String accessTokenUrl, OAuth1Version oauth1Version, ApiAdapter<RestOperations> apiAdapter)
providerId
- Some String that acts as the unique ID for the API provider.consumerKey
- The application's consumer key for the API.consumerSecret
- The application's consumer secret for the API.requestTokenUrl
- The API's OAuth 1.0/1.0a request token URL.authorizeUrl
- The API's OAuth 1.0/1.0a authorization URL.authenticateUrl
- The API's OAuth 1.0/1.0a authentication URL. If null, will default to the authorizeUrl.accessTokenUrl
- The API's OAuth 1.0/1.0a access token URL.oauth1Version
- The version of OAuth 1 (OAuth 1.0 or OAuth 1.0a) supported by the provider.apiAdapter
- A custom implementation of ApiAdapter
used to fetch data when creating the connection.