Class OAuth2AccessTokenJsonExtractor

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      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, java.lang.String response)  
      OAuth2AccessToken extract​(Response response)
      Extracts the concrete type of token from the contents of an Http Response
      protected static java.lang.String extractParameter​(java.lang.String response, java.util.regex.Pattern regexPattern, boolean required)  
      void generateError​(java.lang.String response)
      Related documentation: https://tools.ietf.org/html/rfc6749#section-5.2
      static OAuth2AccessTokenJsonExtractor instance()  
      • Methods inherited from class java.lang.Object

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

      • OAuth2AccessTokenJsonExtractor

        protected OAuth2AccessTokenJsonExtractor()
    • Method Detail

      • 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 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