Class DefaultApi20
java.lang.Object
com.github.scribejava.core.builder.api.DefaultApi20
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 -
Method Summary
Modifier and TypeMethodDescriptioncreateService(String apiKey, String apiSecret, String callback, String defaultScope, String responseType, OutputStream debugStream, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient) abstract StringReturns the URL that receives the access token requests.Returns the access token extractor.Returns the verb for the access token endpoint (defaults to POST)protected abstract StringgetAuthorizationUrl(String responseType, String apiKey, String callback, String scope, String state, Map<String, String> additionalParams) Returns the URL where you should redirect your users to authenticate your application.RFC 8628 OAuth 2.0 Device Authorization GrantAs stated in RFC 7009 OAuth 2.0 Token Revocation
-
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 POST)- Returns:
- access token endpoint verb
-
getAccessTokenEndpoint
Returns the URL that receives the access token requests.- Returns:
- access token URL
-
getRefreshTokenEndpoint
-
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:
-
getAuthorizationBaseUrl
-
getAuthorizationUrl
public String getAuthorizationUrl(String responseType, String apiKey, String callback, String scope, String state, Map<String, String> additionalParams) Returns the URL where you should redirect your users to authenticate your application.- Parameters:
responseType- responseTypeapiKey- apiKeycallback- callbackscope- scopestate- stateadditionalParams- any additional GET params to add to the URL- Returns:
- the URL where you should redirect your users
-
createService
public OAuth20Service createService(String apiKey, String apiSecret, String callback, String defaultScope, String responseType, OutputStream debugStream, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient) -
getBearerSignature
-
getClientAuthentication
-
getDeviceAuthorizationEndpoint
RFC 8628 OAuth 2.0 Device Authorization Grant- Returns:
- the device authorization endpoint
- See Also:
-
getDeviceAuthorizationExtractor
-