OAuth client library APIs for 50+ major OAuth 1.0a and 2.0 providers
—
Custom OAuth service implementations that extend the base OAuth functionality with provider-specific features like additional security measures, custom signature requirements, and specialized token handling.
Facebook-specific OAuth service that adds app secret proof to all authenticated requests for enhanced security.
public class FacebookService extends OAuth20Service {
public FacebookService(FacebookApi api, String apiKey, String apiSecret,
String callback, String defaultScope, String responseType,
OutputStream debugStream, String userAgent,
HttpClientConfig httpClientConfig, HttpClient httpClient);
public void signRequest(String accessToken, OAuthRequest request);
}The Facebook service automatically adds the appsecret_proof parameter to all requests, which is calculated as HMAC-SHA256 of the access token using the app secret as the key.
Usage Example:
// FacebookApi automatically creates FacebookService
OAuth20Service service = new ServiceBuilder("app_id")
.apiSecret("app_secret")
.callback("callback_url")
.build(FacebookApi.instance());
// When making requests, appsecret_proof is automatically added
OAuthRequest request = new OAuthRequest(Verb.GET, "https://graph.facebook.com/me");
service.signRequest(accessToken.getAccessToken(), request);
// Request will include: appsecret_proof=<hmac_sha256_signature>Instagram-specific OAuth service for Instagram API integration.
public class InstagramService extends OAuth20Service {
public InstagramService(InstagramApi api, String apiKey, String apiSecret,
String callback, String defaultScope, String responseType,
OutputStream debugStream, String userAgent,
HttpClientConfig httpClientConfig, HttpClient httpClient);
}Usage Example:
// InstagramApi creates InstagramService automatically
OAuth20Service service = new ServiceBuilder("client_id")
.apiSecret("client_secret")
.callback("callback_url")
.build(InstagramApi.instance());Mail.ru-specific OAuth service that adds signature parameter for API requests.
public class MailruOAuthService extends OAuth20Service {
public MailruOAuthService(MailruApi api, String apiKey, String apiSecret,
String callback, String defaultScope, String responseType,
OutputStream debugStream, String userAgent,
HttpClientConfig httpClientConfig, HttpClient httpClient);
public void signRequest(String accessToken, OAuthRequest request);
}The Mail.ru service automatically adds a signature parameter to requests based on Mail.ru's API requirements.
Usage Example:
// MailruApi creates MailruOAuthService automatically
OAuth20Service service = new ServiceBuilder("client_id")
.apiSecret("client_secret")
.callback("callback_url")
.build(MailruApi.instance());
// Signature is automatically added to requests
OAuthRequest request = new OAuthRequest(Verb.GET, "https://www.appsmail.ru/platform/api");
service.signRequest(accessToken.getAccessToken(), request);Polar-specific OAuth service for Polar fitness platform integration.
public class PolarOAuthService extends OAuth20Service {
public PolarOAuthService(PolarAPI api, String apiKey, String apiSecret,
String callback, String defaultScope, String responseType,
OutputStream debugStream, String userAgent,
HttpClientConfig httpClientConfig, HttpClient httpClient);
}Usage Example:
// PolarAPI creates PolarOAuthService automatically
OAuth20Service service = new ServiceBuilder("client_id")
.apiSecret("client_secret")
.callback("callback_url")
.build(PolarAPI.instance());Wunderlist-specific OAuth service for Wunderlist task management integration.
public class WunderlistOAuthService extends OAuth20Service {
public WunderlistOAuthService(WunderlistAPI api, String apiKey, String apiSecret,
String callback, String defaultScope, String responseType,
OutputStream debugStream, String userAgent,
HttpClientConfig httpClientConfig, HttpClient httpClient);
}Usage Example:
// WunderlistAPI creates WunderlistOAuthService automatically
OAuth20Service service = new ServiceBuilder("client_id")
.apiSecret("client_secret")
.callback("callback_url")
.build(WunderlistAPI.instance());Imgur-specific OAuth service for Imgur image hosting integration.
public class ImgurOAuthService extends OAuth20Service {
public ImgurOAuthService(ImgurApi api, String apiKey, String apiSecret,
String callback, String defaultScope, String responseType,
OutputStream debugStream, String userAgent,
HttpClientConfig httpClientConfig, HttpClient httpClient);
}Usage Example:
// ImgurApi creates ImgurOAuthService automatically
OAuth20Service service = new ServiceBuilder("client_id")
.apiSecret("client_secret")
.callback("callback_url")
.build(ImgurApi.instance());Odnoklassniki-specific OAuth service that adds signature parameter for Russian social network API.
public class OdnoklassnikiOAuthService extends OAuth20Service {
public OdnoklassnikiOAuthService(OdnoklassnikiApi api, String apiKey, String apiSecret,
String callback, String defaultScope, String responseType,
OutputStream debugStream, String userAgent,
HttpClientConfig httpClientConfig, HttpClient httpClient);
public void signRequest(String accessToken, OAuthRequest request);
}The Odnoklassniki service automatically adds a signature parameter to requests based on Odnoklassniki's API security requirements.
Usage Example:
// OdnoklassnikiApi creates OdnoklassnikiOAuthService automatically
OAuth20Service service = new ServiceBuilder("application_key")
.apiSecret("secret_key")
.callback("callback_url")
.build(OdnoklassnikiApi.instance());
// Signature is automatically added to requests
OAuthRequest request = new OAuthRequest(Verb.GET, "https://api.odnoklassniki.ru/fb.do");
service.signRequest(accessToken.getAccessToken(), request);Specialized services are automatically created when using the corresponding API classes through the createService() method override:
// Base API method that specialized APIs override
public OAuth20Service createService(String apiKey, String apiSecret, String callback,
String defaultScope, String responseType,
OutputStream debugStream, String userAgent,
HttpClientConfig httpClientConfig, HttpClient httpClient);appsecret_proof parameter using HMAC-SHA256 signatureAll specialized services maintain the same OAuth20Service interface, so they can be used exactly like standard OAuth services. The provider-specific functionality is applied automatically when signing requests.
// All specialized services follow this pattern:
OAuth20Service service = new ServiceBuilder("client_id")
.apiSecret("client_secret")
.callback("callback_url")
.build(SpecializedApi.instance()); // Returns specialized service automatically
// Standard OAuth flow works the same
String authUrl = service.getAuthorizationUrl();
OAuth2AccessToken token = service.getAccessToken("authorization_code");
// Provider-specific features are applied automatically
OAuthRequest request = new OAuthRequest(Verb.GET, "https://api.provider.com/endpoint");
service.signRequest(token.getAccessToken(), request); // Specialized signing applied here
Response response = service.execute(request);Install with Tessl CLI
npx tessl i tessl/maven-com-github-scribejava--scribejava-apis