def sign_request(request)
      super(request)
      header = @token_provider.get_authentication_header

      if (request.respond_to?(:request_headers))
        request.request_headers[AUTHORIZATION] = header
      elsif request.respond_to?(:headers)
        request.headers[AUTHORIZATION] = header
      else
        fail ArgumentError, 'Incorrect request object was provided'
      end
    end
def sign_request(request)
      super(request)
      header = @token_provider.get_authentication_header

      if (request.respond_to?(:request_headers))
        request.request_headers[AUTHORIZATION] = header
      elsif request.respond_to?(:headers)
        request.headers[AUTHORIZATION] = header
      else
        fail ArgumentError, 'Incorrect request object was provided'
      end
    end
Creates and initialize new instance of the TokenCredentials class.
 @param token_provider [TokenProvider] the token provider.
 @param token [String] the token.

 Attaches OAuth authentication header to the given HTTP request.
 @param request [Net::HTTPRequest] the request authentication header needs to be attached to.

 @return [Net::HTTPRequest] request with attached authentication header