public class GenericOAuth2ConnectionFactory extends OAuth2ConnectionFactory<org.springframework.web.client.RestOperations>
OAuth2ConnectionFactory 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 |
|---|
GenericOAuth2ConnectionFactory(java.lang.String providerId,
java.lang.String appId,
java.lang.String appSecret,
java.lang.String authorizeUrl,
java.lang.String accessTokenUrl,
ApiAdapter<org.springframework.web.client.RestOperations> apiAdapter)
Creates an instance of GenericOAuth2ConnectionFactory.
|
GenericOAuth2ConnectionFactory(java.lang.String providerId,
java.lang.String appId,
java.lang.String appSecret,
java.lang.String authorizeUrl,
java.lang.String authenticateUrl,
java.lang.String accessTokenUrl,
boolean sendClientCredentialsAsParameters,
TokenStrategy tokenStrategy,
ApiAdapter<org.springframework.web.client.RestOperations> apiAdapter)
Creates an instance of GenericOAuth2ConnectionFactory for a provider that offers a separate authentication URL.
|
createConnection, createConnection, extractProviderUserId, generateState, getOAuthOperations, getScope, setScope, supportsStateParametergetApiAdapter, getProviderId, getServiceProviderpublic GenericOAuth2ConnectionFactory(java.lang.String providerId,
java.lang.String appId,
java.lang.String appSecret,
java.lang.String authorizeUrl,
java.lang.String accessTokenUrl,
ApiAdapter<org.springframework.web.client.RestOperations> apiAdapter)
providerId - Some String that acts as the unique ID for the API provider.appId - The application's ID/key for the API.appSecret - The application's secret for the API.authorizeUrl - The API's OAuth 2 authorization URL. Will also be used as the default authentication URL.accessTokenUrl - The API's OAuth 2 access token URL.apiAdapter - A custom implementation of ApiAdapter used to fetch data when creating the connection.public GenericOAuth2ConnectionFactory(java.lang.String providerId,
java.lang.String appId,
java.lang.String appSecret,
java.lang.String authorizeUrl,
java.lang.String authenticateUrl,
java.lang.String accessTokenUrl,
boolean sendClientCredentialsAsParameters,
TokenStrategy tokenStrategy,
ApiAdapter<org.springframework.web.client.RestOperations> apiAdapter)
providerId - Some String that acts as the unique ID for the API provider.appId - The application's ID/key for the API.appSecret - The application's secret for the API.authorizeUrl - The API's OAuth 2 authorization URL.authenticateUrl - The API's OAuth 2 authentication URL.accessTokenUrl - The API's OAuth2 access token URL.sendClientCredentialsAsParameters - If true, send client credentials as query parameter. If false, use HTTP Basic.tokenStrategy - The token strategy indicating how the access token should be carried on API requests.apiAdapter - A custom implementation of ApiAdapter used to fetch data when creating the connection.