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
    protected OAuth2AccessTokenJsonExtractor()  
  • Method Summary

    Modifier and Type Method Description
    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)  
    OAuth2AccessToken extract​(Response response)
    Extracts the concrete type of token from the contents of an Http Response
    void generateError​(java.lang.String rawResponse)
    Related documentation: https://tools.ietf.org/html/rfc6749#section-5.2
    static OAuth2AccessTokenJsonExtractor instance()  

    Methods inherited from class com.github.scribejava.core.extractors.AbstractJsonExtractor

    extractRequiredParameter

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • instance

      public static OAuth2AccessTokenJsonExtractor instance()
    • extract

      public OAuth2AccessToken extract​(Response response) throws java.io.IOException
      Description copied from interface: TokenExtractor
      Extracts the concrete type of token from the contents of an Http Response
      Specified by:
      extract in interface TokenExtractor<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 rawResponse) throws java.io.IOException
      Related documentation: https://tools.ietf.org/html/rfc6749#section-5.2
      Parameters:
      rawResponse - 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)