diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php index de749e2b7d97dba398b2f78de582b168264ec2ad..ef9ccefe313181a8207b22ddd1a0b1f0290809ec 100644 --- a/lib/SimpleSAML/Session.php +++ b/lib/SimpleSAML/Session.php @@ -5,7 +5,6 @@ require_once('SimpleSAML/Utilities.php'); require_once('SimpleSAML/Session.php'); require_once('SimpleSAML/SessionHandler.php'); require_once('SimpleSAML/Metadata/MetaDataStorageHandler.php'); -require_once('SimpleSAML/XML/AuthnResponse.php'); /** * The Session class holds information about a user session, and everything attached to it. diff --git a/lib/SimpleSAML/XML/SAML20/LogoutRequest.php b/lib/SimpleSAML/XML/SAML20/LogoutRequest.php index 50b3dcd37a16f20e5dea1c00031362d206a964aa..dd595a2460930cbe471bc7489e666c14ce61dd7f 100644 --- a/lib/SimpleSAML/XML/SAML20/LogoutRequest.php +++ b/lib/SimpleSAML/XML/SAML20/LogoutRequest.php @@ -130,36 +130,19 @@ class SimpleSAML_XML_SAML20_LogoutRequest { $issueInstant = self::generateIssueInstant(); $destination = $receivermd['SingleLogoutService']; - -/* - $spNameQualifier = $md['spNameQualifier']; - $nameidformat = isset($md['NameIDformat']) ? - $md['NameIDformat'] : - 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent'; - */ - $logoutRequest = "<samlp:LogoutRequest " . - "xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" " . - "ID=\"" . $id . "\" " . - "Version=\"2.0\" " . - "Destination=\"" . htmlspecialchars($destination) . "\" " . - "IssueInstant=\"" . $issueInstant . "\"> " . - "<saml:Issuer " . - "xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\">" . - htmlspecialchars($issuer) . - "</saml:Issuer>" . - "<saml:NameID " . - "xmlns:saml=\"urn:oasis:names:tc:SAML:2.0:assertion\" " . -// "NameQualifier=\"" . $nameId["NameQualifier"] . "\" " . -// "SPNameQualifier=\"" . $nameId["SPNameQualifier"] . "\" " . - "Format=\"" . htmlspecialchars($nameid['Format']) . "\">" . - htmlspecialchars($nameid['value']) . - "</saml:NameID>" . - "<samlp:SessionIndex " . - "xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\">" . - htmlspecialchars($sessionindex) . - "</samlp:SessionIndex>" . - "</samlp:LogoutRequest>"; - + + $logoutRequest = '<samlp:LogoutRequest + xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" + xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" + ID="' . $id . '" Version="2.0" + Destination="' . htmlspecialchars($destination) . '" + IssueInstant="' . $issueInstant . '"> + <saml:Issuer >' . htmlspecialchars($issuer) . '</saml:Issuer> + <saml:NameID Format="' . htmlspecialchars($nameid['Format']) . '">' . htmlspecialchars($nameid['value']) . '</saml:NameID> + <samlp:SessionIndex>' . htmlspecialchars($sessionindex) . '</samlp:SessionIndex> +</samlp:LogoutRequest> +'; + return $logoutRequest; } diff --git a/lib/SimpleSAML/XML/SAML20/LogoutResponse.php b/lib/SimpleSAML/XML/SAML20/LogoutResponse.php index 84fe044fcc767df8fb69509354126fc636607465..80fe4b0bb2581926f35c68243e61607a1ac99241 100644 --- a/lib/SimpleSAML/XML/SAML20/LogoutResponse.php +++ b/lib/SimpleSAML/XML/SAML20/LogoutResponse.php @@ -112,18 +112,20 @@ class SimpleSAML_XML_SAML20_LogoutResponse { $destination = $receivermd['SingleLogoutService']; - $samlResponse = '<samlp:LogoutResponse xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" -ID="_' . $id . '" Version="2.0" IssueInstant="' . $issueInstant . '" Destination="'. htmlspecialchars($destination). '" InResponseTo="' . htmlspecialchars($inresponseto) . '"> -<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">' . htmlspecialchars($issuer) . '</saml:Issuer> -<samlp:Status xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"> -<samlp:StatusCode xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" -Value="urn:oasis:names:tc:SAML:2.0:status:Success"> -</samlp:StatusCode> -<samlp:StatusMessage xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"> -Successfully logged out from service ' . htmlspecialchars($issuer) . ' -</samlp:StatusMessage> -</samlp:Status> -</samlp:LogoutResponse>'; + $samlResponse = '<samlp:LogoutResponse + xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" + xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" + ID="' . $id . '" Version="2.0" + IssueInstant="' . $issueInstant . '" + Destination="'. htmlspecialchars($destination). '" + InResponseTo="' . htmlspecialchars($inresponseto) . '"> + <saml:Issuer>' . htmlspecialchars($issuer) . '</saml:Issuer> + <samlp:Status> + <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"> </samlp:StatusCode> + <samlp:StatusMessage>Successfully logged out from service ' . htmlspecialchars($issuer) . '</samlp:StatusMessage> + </samlp:Status> +</samlp:LogoutResponse> +'; return $samlResponse; }