Class DefaultApi10a
- java.lang.Object
-
- com.github.scribejava.core.builder.api.DefaultApi10a
-
public abstract class DefaultApi10a extends Object
Default implementation of the OAuth protocol, version 1.0a 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 1.0a 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 DefaultApi10a()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description OAuth10aService
createService(String apiKey, String apiSecret, String callback, String scope, OutputStream debugStream, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)
abstract String
getAccessTokenEndpoint()
Returns the URL that receives the access token requests.TokenExtractor<OAuth1AccessToken>
getAccessTokenExtractor()
Returns the access token extractor.Verb
getAccessTokenVerb()
Returns the verb for the access token endpoint (defaults to POST)protected abstract String
getAuthorizationBaseUrl()
String
getAuthorizationUrl(OAuth1RequestToken requestToken)
Returns the URL where you should redirect your users to authenticate your application.BaseStringExtractor
getBaseStringExtractor()
Returns the base string extractor.HeaderExtractor
getHeaderExtractor()
Returns the header extractor.abstract String
getRequestTokenEndpoint()
Returns the URL that receives the request token requests.TokenExtractor<OAuth1RequestToken>
getRequestTokenExtractor()
Returns the request token extractor.Verb
getRequestTokenVerb()
Returns the verb for the request token endpoint (defaults to POST)SignatureService
getSignatureService()
Returns the signature service.OAuth1SignatureType
getSignatureType()
TimestampService
getTimestampService()
Returns the timestamp service.boolean
isEmptyOAuthTokenParamIsRequired()
http://tools.ietf.org/html/rfc5849 says that "The client MAY omit the empty "oauth_token" protocol parameter from the request", but not all oauth servers are good boys.
-
-
-
Method Detail
-
getAccessTokenExtractor
public TokenExtractor<OAuth1AccessToken> getAccessTokenExtractor()
Returns the access token extractor.- Returns:
- access token extractor
-
getBaseStringExtractor
public BaseStringExtractor getBaseStringExtractor()
Returns the base string extractor.- Returns:
- base string extractor
-
getHeaderExtractor
public HeaderExtractor getHeaderExtractor()
Returns the header extractor.- Returns:
- header extractor
-
getRequestTokenExtractor
public TokenExtractor<OAuth1RequestToken> getRequestTokenExtractor()
Returns the request token extractor.- Returns:
- request token extractor
-
getSignatureService
public SignatureService getSignatureService()
Returns the signature service.- Returns:
- signature service
-
getSignatureType
public OAuth1SignatureType getSignatureType()
- Returns:
- the signature type, choose between header, querystring, etc. Defaults to Header
-
getTimestampService
public TimestampService getTimestampService()
Returns the timestamp service.- Returns:
- timestamp service
-
getAccessTokenVerb
public Verb getAccessTokenVerb()
Returns the verb for the access token endpoint (defaults to POST)- Returns:
- access token endpoint verb
-
getRequestTokenVerb
public Verb getRequestTokenVerb()
Returns the verb for the request token endpoint (defaults to POST)- Returns:
- request token endpoint verb
-
getRequestTokenEndpoint
public abstract String getRequestTokenEndpoint()
Returns the URL that receives the request token requests.- Returns:
- request token URL
-
getAccessTokenEndpoint
public abstract String getAccessTokenEndpoint()
Returns the URL that receives the access token requests.- Returns:
- access token URL
-
getAuthorizationBaseUrl
protected abstract String getAuthorizationBaseUrl()
-
getAuthorizationUrl
public String getAuthorizationUrl(OAuth1RequestToken requestToken)
Returns the URL where you should redirect your users to authenticate your application.- Parameters:
requestToken
- the request token you need to authorize- Returns:
- the URL where you should redirect your users
-
createService
public OAuth10aService createService(String apiKey, String apiSecret, String callback, String scope, OutputStream debugStream, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)
-
isEmptyOAuthTokenParamIsRequired
public boolean isEmptyOAuthTokenParamIsRequired()
http://tools.ietf.org/html/rfc5849 says that "The client MAY omit the empty "oauth_token" protocol parameter from the request", but not all oauth servers are good boys.- Returns:
- whether to inlcude empty oauth_token param to the request
-
-