Class OAuth2AccessTokenJsonExtractor
- java.lang.Object
-
- com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor
-
- All Implemented Interfaces:
TokenExtractor<OAuth2AccessToken>
public class OAuth2AccessTokenJsonExtractor extends java.lang.Object implements TokenExtractor<OAuth2AccessToken>
JSON (default) implementation ofTokenExtractorfor OAuth 2.0
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedOAuth2AccessTokenJsonExtractor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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, java.lang.String response)OAuth2AccessTokenextract(Response response)Extracts the concrete type of token from the contents of an Http Responseprotected static java.lang.StringextractParameter(java.lang.String response, java.util.regex.Pattern regexPattern, boolean required)voidgenerateError(java.lang.String response)Related documentation: https://tools.ietf.org/html/rfc6749#section-5.2static OAuth2AccessTokenJsonExtractorinstance()
-
-
-
Method Detail
-
instance
public static OAuth2AccessTokenJsonExtractor instance()
-
extract
public OAuth2AccessToken extract(Response response) throws java.io.IOException
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
public void generateError(java.lang.String response)
Related documentation: https://tools.ietf.org/html/rfc6749#section-5.2- Parameters:
response- response
-
createToken
protected OAuth2AccessToken createToken(java.lang.String accessToken, java.lang.String tokenType, java.lang.Integer expiresIn, java.lang.String refreshToken, java.lang.String scope, java.lang.String response)
-
extractParameter
protected static java.lang.String extractParameter(java.lang.String response, java.util.regex.Pattern regexPattern, boolean required) throws OAuthException- Throws:
OAuthException
-
-