Class OAuth2AccessTokenJsonExtractor
java.lang.Object
com.github.scribejava.core.extractors.AbstractJsonExtractor
com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor
- All Implemented Interfaces:
TokenExtractor<OAuth2AccessToken>
public class OAuth2AccessTokenJsonExtractor extends AbstractJsonExtractor implements TokenExtractor<OAuth2AccessToken>
JSON (default) implementation of
TokenExtractor for OAuth 2.0-
Field Summary
Fields inherited from class com.github.scribejava.core.extractors.AbstractJsonExtractor
OBJECT_MAPPER -
Constructor Summary
Constructors Modifier Constructor Description protectedOAuth2AccessTokenJsonExtractor() -
Method Summary
Modifier and Type Method Description protected OAuth2AccessTokencreateToken(java.lang.String accessToken, java.lang.String tokenType, java.lang.Integer expiresIn, java.lang.String refreshToken, java.lang.String scope, com.fasterxml.jackson.databind.JsonNode response, java.lang.String rawResponse)OAuth2AccessTokenextract(Response response)Extracts the concrete type of token from the contents of an Http ResponsevoidgenerateError(Response response)Related documentation: https://tools.ietf.org/html/rfc6749#section-5.2voidgenerateError(java.lang.String rawResponse)Deprecated.static OAuth2AccessTokenJsonExtractorinstance()Methods inherited from class com.github.scribejava.core.extractors.AbstractJsonExtractor
extractRequiredParameterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
OAuth2AccessTokenJsonExtractor
protected OAuth2AccessTokenJsonExtractor()
-
-
Method Details
-
instance
-
extract
Description copied from interface:TokenExtractorExtracts the concrete type of token from the contents of an Http Response- Specified by:
extractin interfaceTokenExtractor<OAuth2AccessToken>- Parameters:
response- the whole response- Returns:
- OAuth access token
- Throws:
java.io.IOException- in case of troubles while getting body from the response
-
generateError
@Deprecated public void generateError(java.lang.String rawResponse) throws java.io.IOExceptionDeprecated.- Parameters:
rawResponse- rawResponse- Throws:
java.io.IOException- IOException
-
generateError
Related documentation: https://tools.ietf.org/html/rfc6749#section-5.2- Parameters:
response- response- Throws:
java.io.IOException- IOException
-
createToken
protected OAuth2AccessToken createToken(java.lang.String accessToken, java.lang.String tokenType, java.lang.Integer expiresIn, java.lang.String refreshToken, java.lang.String scope, com.fasterxml.jackson.databind.JsonNode response, java.lang.String rawResponse)
-
generateError(com.github.scribejava.core.model.Response)