def authenticate(timestamp_grace = 600)
      raise ArgumentError, "Block required" unless block_given?
      key = @auth_hash['auth_key']
      raise AuthenticationError, "Missing parameter: auth_key" unless key
      token = yield key
      unless token
        raise AuthenticationError, "Unknown auth_key"
      end
      authenticate_by_token!(token, timestamp_grace)
      return token
    end
def authenticate(timestamp_grace = 600)
      raise ArgumentError, "Block required" unless block_given?
      key = @auth_hash['auth_key']
      raise AuthenticationError, "Missing parameter: auth_key" unless key
      token = yield key
      unless token
        raise AuthenticationError, "Unknown auth_key"
      end
      authenticate_by_token!(token, timestamp_grace)
      return token
    end
Authenticate a request

 Takes a block which will be called with the auth_key from the request,
 and which should return a Signature::Token (or nil if no token can be
 found for the key)

 Raises errors in the same way as authenticate_by_token!