public class GenericOAuth1ServiceProvider extends AbstractOAuth1ServiceProvider<org.springframework.web.client.RestOperations>
OAuth1ServiceProvider 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 service provider is simply a RestOperations, but the underlying RestTemplate is configured to automatically
add Authorization headers to all requests.| Constructor and Description |
|---|
GenericOAuth1ServiceProvider(java.lang.String consumerKey,
java.lang.String consumerSecret,
java.lang.String requestTokenUrl,
java.lang.String authorizeUrl,
java.lang.String authenticateUrl,
java.lang.String accessTokenUrl,
OAuth1Version oauth1Version)
Creates an instance of GenericOAuth1ServiceProvider for a provider that offers a separate authentication URL.
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.web.client.RestOperations |
getApi(java.lang.String accessToken,
java.lang.String secret)
Returns an API interface allowing the client application to access protected resources on behalf of a user.
|
getConsumerKey, getConsumerSecret, getOAuthOperationspublic GenericOAuth1ServiceProvider(java.lang.String consumerKey,
java.lang.String consumerSecret,
java.lang.String requestTokenUrl,
java.lang.String authorizeUrl,
java.lang.String authenticateUrl,
java.lang.String accessTokenUrl,
OAuth1Version oauth1Version)
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, then the authorization URL will be used by default.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.public org.springframework.web.client.RestOperations getApi(java.lang.String accessToken,
java.lang.String secret)
OAuth1ServiceProvidergetApi in interface OAuth1ServiceProvider<org.springframework.web.client.RestOperations>getApi in class AbstractOAuth1ServiceProvider<org.springframework.web.client.RestOperations>accessToken - the API access tokensecret - the access token secret