src/Saml.php
public function buildAuthnRequest()
    {
        $authnRequest = (new AuthnRequest())
            ->setAssertionConsumerServiceURL($this->getMetadata()->getFirstAcs()->getLocation())
            ->setProtocolBinding($this->getMetadata()->getFirstAcs()->getBinding())
            ->setID(Helper::generateID())
            ->setIssueInstant(new \DateTime())
            ->setDestination($this->getMetadata()->getFirstSso()->getLocation())
            ->setIssuer(new Issuer($this->getMetadata()->getServiceProvider()->getEntityID()))
            ->setRelayState(Helper::generateID());

        if ($this->getMetadata()->getFirstIdpSsoDescriptor()->getWantAuthnRequestsSigned()) {
            $authnRequest->setSignature(
                new SignatureWriter(
                    $this->getMetadata()
                        ->getFirstSpSsoDescriptor()
                        ->getFirstKeyDescriptor(KeyDescriptor::USE_SIGNING)
                        ->getCertificate(),
                    KeyHelper::createPrivateKey($this->getPrivateKey(), '')
                )
            );
        }

        return $authnRequest;
    }
public function buildAuthnRequest()
    {
        $authnRequest = (new AuthnRequest())
            ->setAssertionConsumerServiceURL($this->getMetadata()->getFirstAcs()->getLocation())
            ->setProtocolBinding($this->getMetadata()->getFirstAcs()->getBinding())
            ->setID(Helper::generateID())
            ->setIssueInstant(new \DateTime())
            ->setDestination($this->getMetadata()->getFirstSso()->getLocation())
            ->setIssuer(new Issuer($this->getMetadata()->getServiceProvider()->getEntityID()))
            ->setRelayState(Helper::generateID());

        if ($this->getMetadata()->getFirstIdpSsoDescriptor()->getWantAuthnRequestsSigned()) {
            $authnRequest->setSignature(
                new SignatureWriter(
                    $this->getMetadata()
                        ->getFirstSpSsoDescriptor()
                        ->getFirstKeyDescriptor(KeyDescriptor::USE_SIGNING)
                        ->getCertificate(),
                    KeyHelper::createPrivateKey($this->getPrivateKey(), '')
                )
            );
        }

        return $authnRequest;
    }
public function buildAuthnRequest ( ) { $ authnRequest = ( new AuthnRequest ( ) ) -> setAssertionConsumerServiceURL ( $ this -> getMetadata ( ) -> getFirstAcs ( ) -> getLocation ( ) ) -> setProtocolBinding ( $ this -> getMetadata ( ) -> getFirstAcs ( ) -> getBinding ( ) ) -> setID ( Helper :: generateID ( ) ) -> setIssueInstant ( new \ DateTime ( ) ) -> setDestination ( $ this -> getMetadata ( ) -> getFirstSso ( ) -> getLocation ( ) ) -> setIssuer ( new Issuer ( $ this -> getMetadata ( ) -> getServiceProvider ( ) -> getEntityID ( ) ) ) -> setRelayState ( Helper :: generateID ( ) ) ; if ( $ this -> getMetadata ( ) -> getFirstIdpSsoDescriptor ( ) -> getWantAuthnRequestsSigned ( ) ) { $ authnRequest -> setSignature ( new SignatureWriter ( $ this -> getMetadata ( ) -> getFirstSpSsoDescriptor ( ) -> getFirstKeyDescriptor ( KeyDescriptor :: USE_SIGNING ) -> getCertificate ( ) , KeyHelper :: createPrivateKey ( $ this -> getPrivateKey ( ) , '' ) ) ) ; } return $ authnRequest ; }
Returns a AuthnRequest

@return \LightSaml\Model\Protocol\SamlMessage
Returns a AuthnRequest