sspmod_saml_Message::buildLogoutRequest PHP Method

buildLogoutRequest() public static method

Build a logout request based on information in the metadata.
public static buildLogoutRequest ( SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata )
$srcMetadata SimpleSAML_Configuration The metadata of the sender.
$dstMetadata SimpleSAML_Configuration
    public static function buildLogoutRequest(SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata)
    {
        $lr = new \SAML2\LogoutRequest();
        $lr->setIssuer($srcMetadata->getString('entityid'));
        self::addRedirectSign($srcMetadata, $dstMetadata, $lr);
        return $lr;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Build a logout request based on information in the metadata.
  *
  * @param SimpleSAML_Configuration idpMetadata  The metadata of the IdP.
  * @param SimpleSAML_Configuration spMetadata  The metadata of the SP.
  * @param array $association  The SP association.
  * @param string|NULL $relayState  An id that should be carried across the logout.
  */
 private static function buildLogoutRequest(SimpleSAML_Configuration $idpMetadata, SimpleSAML_Configuration $spMetadata, array $association, $relayState)
 {
     $lr = sspmod_saml_Message::buildLogoutRequest($idpMetadata, $spMetadata);
     $lr->setRelayState($relayState);
     $lr->setSessionIndex($association['saml:SessionIndex']);
     $lr->setNameId($association['saml:NameID']);
     $assertionLifetime = $spMetadata->getInteger('assertion.lifetime', NULL);
     if ($assertionLifetime === NULL) {
         $assertionLifetime = $idpMetadata->getInteger('assertion.lifetime', 300);
     }
     $lr->setNotOnOrAfter(time() + $assertionLifetime);
     $encryptNameId = $spMetadata->getBoolean('nameid.encryption', NULL);
     if ($encryptNameId === NULL) {
         $encryptNameId = $idpMetadata->getBoolean('nameid.encryption', FALSE);
     }
     if ($encryptNameId) {
         $lr->encryptNameId(sspmod_saml_Message::getEncryptionKey($spMetadata));
     }
     return $lr;
 }
All Usage Examples Of sspmod_saml_Message::buildLogoutRequest