/** * @return AuthnRequest */ public function build() { $result = new AuthnRequest(); $edSP = $this->getEdSP(); $result->setID(Helper::generateID()); $result->setDestination($this->getDestination()); $result->setIssueInstant(time()); $asc = $this->getAssertionConsumerService(); $result->setAssertionConsumerServiceURL($asc->getLocation()); $result->setProtocolBinding($asc->getBinding()); $result->setIssuer($edSP->getEntityID()); if ($this->spMeta->getNameIdFormat()) { $result->setNameIdPolicyFormat($this->spMeta->getNameIdFormat()); } return $result; }