private function check_nonce($consumer, $token, $nonce, $timestamp)
    {
        if( ! $nonce )
            throw new Exception(
                'Missing nonce parameter. The parameter is required'
            );

        // verify that the nonce is uniqueish
        $found = $this->data_store->lookup_nonce(
            $consumer,
            $token,
            $nonce,
            $timestamp
        );
        if ($found) {
            throw new Exception("Nonce already used: $nonce");
        }
    }