Exemplo n.º 1
0
 /**
  * @param string $nameIdFormat
  * @throws \InvalidArgumentException
  */
 public function setNameIdFormat($nameIdFormat)
 {
     if (!NameIDPolicy::isValid($nameIdFormat)) {
         throw new \InvalidArgumentException('Invalid NameIDFormat ' . $nameIdFormat);
     }
     $this->nameIdFormat = $nameIdFormat;
 }
Exemplo n.º 2
0
 /**
  * @param string $value
  * @throws \InvalidArgumentException
  * @return $this|NameIDFormat
  */
 public function setValue($value)
 {
     $value = trim($value);
     if ($value && false == NameIDPolicy::isValid($value)) {
         throw new \InvalidArgumentException(sprintf("Invalid NameIDFormat '%s'", $value));
     }
     $this->value = $value;
     return $this;
 }
Exemplo n.º 3
0
 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');
     }
 }