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
public abstract class DefaultApi20 extends java.lang.Object implements Api
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 Constructor Description DefaultApi20()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description OAuthService
createService(OAuthConfig config)
Creates anOAuthService
abstract java.lang.String
getAccessTokenEndpoint()
Returns the URL that receives the access token requests.AccessTokenExtractor
getAccessTokenExtractor()
Returns the access token extractor.Verb
getAccessTokenVerb()
Returns the verb for the access token endpoint (defaults to GET)abstract java.lang.String
getAuthorizationUrl(OAuthConfig config)
Returns the URL where you should redirect your users to authenticate your application.
-
-
-
Method Detail
-
getAccessTokenExtractor
public AccessTokenExtractor getAccessTokenExtractor()
Returns the access token extractor.- Returns:
- access token extractor
-
getAccessTokenVerb
public Verb getAccessTokenVerb()
Returns the verb for the access token endpoint (defaults to GET)- Returns:
- access token endpoint verb
-
getAccessTokenEndpoint
public abstract java.lang.String getAccessTokenEndpoint()
Returns the URL that receives the access token requests.- Returns:
- access token URL
-
getAuthorizationUrl
public abstract java.lang.String getAuthorizationUrl(OAuthConfig config)
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
public OAuthService createService(OAuthConfig config)
Creates anOAuthService
- Specified by:
createService
in interfaceApi
- Returns:
- fully configured
OAuthService
-
-