protected function validateSynchronizerToken(array $payload=null)
    {
        if ($this->configuration->get('csrf_protection')) {
            if (!is_null($payload) && isset($payload[$this->configuration->get('csrf_parameter')])) {

                $this->logger->debug('validate synchronizer token', array('name' => $this->getName(), 'token' => $payload[$this->configuration->get('csrf_parameter')]));
                $token = $payload[$this->configuration->get('csrf_parameter')];

                if ($this->synchronizerToken->validate($this->getName(), $token)) {
                    $this->logger->debug('valid synchronizer token given', array('name' => $this->getName(), 'token' => $payload[$this->configuration->get('csrf_parameter')]));
                    return true;
                } else {
                    $this->logger->debug('invalid synchronizer token given', array('name' => $this->getName(), 'token' => $payload[$this->configuration->get('csrf_parameter')]));
                }
            } else {
                $this->logger->debug('no valid synchronizer token given', array('name' => $this->getName()));
            }
            return false;
        } else {
            $this->logger->debug('skip synchronizer token validation', array('name' => $this->getName()));
        }
        return true;
    }