From 3019daacd4b8d1c09ab543c67bf0bd3f7e329f98 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Wed, 4 Jun 2008 08:41:12 +0000
Subject: [PATCH] Metadata/SAMLParser: Make the SingleLogoutService endpoint
 optional for the metadata parser.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@599 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/Metadata/SAMLParser.php | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/lib/SimpleSAML/Metadata/SAMLParser.php b/lib/SimpleSAML/Metadata/SAMLParser.php
index 9ff2dc5d7..cfadb6aec 100644
--- a/lib/SimpleSAML/Metadata/SAMLParser.php
+++ b/lib/SimpleSAML/Metadata/SAMLParser.php
@@ -448,13 +448,10 @@ class SimpleSAML_Metadata_SAMLParser {
 
 		/* Find the single logout service endpoint. */
 		$slo = $this->getDefaultEndpoint($spd['singleLogoutServices'], array(self::SAML_20_REDIRECT_BINDING));
-		if($slo === NULL) {
-			throw new Exception('Could not find any valid SingleLogoutService.' .
-				' simpleSAMLphp currently supports only the http-redirect binding for SAML 2.0 logout.');
+		if($slo !== NULL) {
+			$ret['SingleLogoutService'] = $slo['location'];
 		}
 
-		$ret['SingleLogoutService'] = $slo['location'];
-
 
 		/* Find the NameIDFormat. This may not exists. */
 		if(count($spd['nameIDFormats']) > 0) {
@@ -508,11 +505,9 @@ class SimpleSAML_Metadata_SAMLParser {
 
 		/* Find the single logout service endpoint. */
 		$slo = $this->getDefaultEndpoint($idp['singleLogoutServices'], array(self::SAML_20_REDIRECT_BINDING));
-		if($slo === NULL) {
-			throw new Exception('Could not find any valid SingleLogoutService.' .
-				' simpleSAMLphp currently supports only the http-redirect binding for SAML 2.0 logout.');
+		if($slo !== NULL) {
+			$ret['SingleLogoutService'] = $slo['location'];
 		}
-		$ret['SingleLogoutService'] = $slo['location'];
 
 		/* If the response location is set, include it in the returned metadata. */
 		if($slo['responseLocation']) {
-- 
GitLab