protected function prepareForXml() { parent::prepareForXml(); if (!$this->getAssertionConsumerServiceURL()) { throw new InvalidRequestException('AuthRequest AssertionConsumerServiceURL not set'); } if (!$this->getProtocolBinding()) { throw new InvalidRequestException('AuthnRequest ProtocolBinding not set'); } if (!NameIDPolicy::isValid($this->getNameIdPolicyFormat())) { throw new InvalidRequestException('AuthnRequest NameIDPolicy Format not set'); } }