Class DefaultApi20
- java.lang.Object
-
- com.github.scribejava.core.builder.api.DefaultApi20
-
- All Implemented Interfaces:
BaseApi<OAuth20Service>
public abstract class DefaultApi20 extends java.lang.Object implements BaseApi<OAuth20Service>
Default implementation of the OAuth protocol, version 2.0 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 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 Deprecated Methods Modifier and Type Method Description OAuth20ServicecreateService(java.lang.String apiKey, java.lang.String apiSecret, java.lang.String callback, java.lang.String scope, java.io.OutputStream debugStream, java.lang.String responseType, java.lang.String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)OAuth20ServicecreateService(java.lang.String apiKey, java.lang.String apiSecret, java.lang.String callback, java.lang.String scope, java.io.OutputStream debugStream, java.lang.String state, java.lang.String responseType, java.lang.String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)Deprecated.use one of getAuthorizationUrl method inOAuth20Serviceabstract java.lang.StringgetAccessTokenEndpoint()Returns the URL that receives the access token requests.TokenExtractor<OAuth2AccessToken>getAccessTokenExtractor()Returns the access token extractor.VerbgetAccessTokenVerb()Returns the verb for the access token endpoint (defaults to POST)protected abstract java.lang.StringgetAuthorizationBaseUrl()java.lang.StringgetAuthorizationUrl(java.lang.String responseType, java.lang.String apiKey, java.lang.String callback, java.lang.String scope, java.lang.String state, java.util.Map<java.lang.String,java.lang.String> additionalParams)Returns the URL where you should redirect your users to authenticate your application.BearerSignaturegetBearerSignature()ClientAuthenticationgetClientAuthentication()java.lang.StringgetRefreshTokenEndpoint()java.lang.StringgetRevokeTokenEndpoint()As stated in RFC 7009 OAuth 2.0 Token Revocation
-
-
-
Method Detail
-
getAccessTokenExtractor
public TokenExtractor<OAuth2AccessToken> getAccessTokenExtractor()
Returns the access token extractor.- Returns:
- access token extractor
-
getAccessTokenVerb
public Verb getAccessTokenVerb()
Returns the verb for the access token endpoint (defaults to POST)- 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
-
getRefreshTokenEndpoint
public java.lang.String getRefreshTokenEndpoint()
-
getRevokeTokenEndpoint
public java.lang.String getRevokeTokenEndpoint()
As stated in RFC 7009 OAuth 2.0 Token Revocation- Returns:
- endpoint, which allows clients to notify the authorization server that a previously obtained refresh or access token is no longer needed.
- See Also:
- RFC 7009
-
getAuthorizationBaseUrl
protected abstract java.lang.String getAuthorizationBaseUrl()
-
getAuthorizationUrl
public java.lang.String getAuthorizationUrl(java.lang.String responseType, java.lang.String apiKey, java.lang.String callback, java.lang.String scope, java.lang.String state, java.util.Map<java.lang.String,java.lang.String> additionalParams)Returns the URL where you should redirect your users to authenticate your application.- Parameters:
responseType- responseTypeapiKey- apiKeyadditionalParams- any additional GET params to add to the URLcallback- callbackstate- statescope- scope- Returns:
- the URL where you should redirect your users
-
createService
public OAuth20Service createService(java.lang.String apiKey, java.lang.String apiSecret, java.lang.String callback, java.lang.String scope, java.io.OutputStream debugStream, java.lang.String responseType, java.lang.String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)
- Specified by:
createServicein interfaceBaseApi<OAuth20Service>
-
createService
@Deprecated public OAuth20Service createService(java.lang.String apiKey, java.lang.String apiSecret, java.lang.String callback, java.lang.String scope, java.io.OutputStream debugStream, java.lang.String state, java.lang.String responseType, java.lang.String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient)
Deprecated.use one of getAuthorizationUrl method inOAuth20Service- Specified by:
createServicein interfaceBaseApi<OAuth20Service>- Parameters:
apiKey- apiKeyapiSecret- apiSecretcallback- callbackscope- scopedebugStream- debugStreamstate- stateresponseType- responseTypeuserAgent- userAgenthttpClientConfig- httpClientConfighttpClient- httpClient- Returns:
- return
-
getBearerSignature
public BearerSignature getBearerSignature()
-
getClientAuthentication
public ClientAuthentication getClientAuthentication()
-
-