Package org.scribe.builder.api
Class DefaultApi20
java.lang.Object
org.scribe.builder.api.DefaultApi20
- All Implemented Interfaces:
Api
- Direct Known Subclasses:
ConstantContactApi2,FacebookApi,Foursquare2Api,KaixinApi20,LiveApi,RenrenApi,SinaWeiboApi20,ViadeoApi,VkontakteApi
Default implementation of the OAuth protocol, version 2.0 (draft 11)
This class is meant to be extended by concrete implementations of the API,
providing the endpoints and endpoint-http-verbs.
If your Api adheres to the 2.0 (draft 11) protocol correctly, you just need to extend
this class and define the getters for your endpoints.
If your Api does something a bit different, you can override the different
extractors or services, in order to fine-tune the process. Please read the
javadocs of the interfaces to get an idea of what to do.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateService(OAuthConfig config) Creates anOAuthServiceabstract StringReturns the URL that receives the access token requests.Returns the access token extractor.Returns the verb for the access token endpoint (defaults to GET)abstract StringgetAuthorizationUrl(OAuthConfig config) Returns the URL where you should redirect your users to authenticate your application.
-
Constructor Details
-
DefaultApi20
public DefaultApi20()
-
-
Method Details
-
getAccessTokenExtractor
Returns the access token extractor.- Returns:
- access token extractor
-
getAccessTokenVerb
Returns the verb for the access token endpoint (defaults to GET)- Returns:
- access token endpoint verb
-
getAccessTokenEndpoint
Returns the URL that receives the access token requests.- Returns:
- access token URL
-
getAuthorizationUrl
Returns the URL where you should redirect your users to authenticate your application.- Parameters:
config- OAuth 2.0 configuration param object- Returns:
- the URL where you should redirect your users
-
createService
Creates anOAuthService- Specified by:
createServicein interfaceApi- Returns:
- fully configured
OAuthService
-