Skip to content
Snippets Groups Projects
Commit 847a255b authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Improved the SAML messages templates regarding XML namespaces optimalization...

Improved the SAML messages templates regarding XML namespaces optimalization etc. in the logout request and response.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@221 44740490-163a-0410-bde0-09ae8108e29a
parent fdac05cb
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,6 @@ require_once('SimpleSAML/Utilities.php'); ...@@ -5,7 +5,6 @@ require_once('SimpleSAML/Utilities.php');
require_once('SimpleSAML/Session.php'); require_once('SimpleSAML/Session.php');
require_once('SimpleSAML/SessionHandler.php'); require_once('SimpleSAML/SessionHandler.php');
require_once('SimpleSAML/Metadata/MetaDataStorageHandler.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. * The Session class holds information about a user session, and everything attached to it.
......
...@@ -130,36 +130,19 @@ class SimpleSAML_XML_SAML20_LogoutRequest { ...@@ -130,36 +130,19 @@ class SimpleSAML_XML_SAML20_LogoutRequest {
$issueInstant = self::generateIssueInstant(); $issueInstant = self::generateIssueInstant();
$destination = $receivermd['SingleLogoutService']; $destination = $receivermd['SingleLogoutService'];
/* $logoutRequest = '<samlp:LogoutRequest
$spNameQualifier = $md['spNameQualifier']; xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
$nameidformat = isset($md['NameIDformat']) ? xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
$md['NameIDformat'] : ID="' . $id . '" Version="2.0"
'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent'; Destination="' . htmlspecialchars($destination) . '"
*/ IssueInstant="' . $issueInstant . '">
$logoutRequest = "<samlp:LogoutRequest " . <saml:Issuer >' . htmlspecialchars($issuer) . '</saml:Issuer>
"xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" " . <saml:NameID Format="' . htmlspecialchars($nameid['Format']) . '">' . htmlspecialchars($nameid['value']) . '</saml:NameID>
"ID=\"" . $id . "\" " . <samlp:SessionIndex>' . htmlspecialchars($sessionindex) . '</samlp:SessionIndex>
"Version=\"2.0\" " . </samlp:LogoutRequest>
"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>";
return $logoutRequest; return $logoutRequest;
} }
......
...@@ -112,18 +112,20 @@ class SimpleSAML_XML_SAML20_LogoutResponse { ...@@ -112,18 +112,20 @@ class SimpleSAML_XML_SAML20_LogoutResponse {
$destination = $receivermd['SingleLogoutService']; $destination = $receivermd['SingleLogoutService'];
$samlResponse = '<samlp:LogoutResponse xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" $samlResponse = '<samlp:LogoutResponse
ID="_' . $id . '" Version="2.0" IssueInstant="' . $issueInstant . '" Destination="'. htmlspecialchars($destination). '" InResponseTo="' . htmlspecialchars($inresponseto) . '"> xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">' . htmlspecialchars($issuer) . '</saml:Issuer> xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
<samlp:Status xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"> ID="' . $id . '" Version="2.0"
<samlp:StatusCode xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" IssueInstant="' . $issueInstant . '"
Value="urn:oasis:names:tc:SAML:2.0:status:Success"> Destination="'. htmlspecialchars($destination). '"
</samlp:StatusCode> InResponseTo="' . htmlspecialchars($inresponseto) . '">
<samlp:StatusMessage xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"> <saml:Issuer>' . htmlspecialchars($issuer) . '</saml:Issuer>
Successfully logged out from service ' . htmlspecialchars($issuer) . ' <samlp:Status>
</samlp:StatusMessage> <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"> </samlp:StatusCode>
</samlp:Status> <samlp:StatusMessage>Successfully logged out from service ' . htmlspecialchars($issuer) . '</samlp:StatusMessage>
</samlp:LogoutResponse>'; </samlp:Status>
</samlp:LogoutResponse>
';
return $samlResponse; return $samlResponse;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment