Skip to content

Commit ec05324

Browse files
committed
read ResponseLocation from idP metadata
1 parent ecc1abc commit ec05324

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

lib/Saml2/IdPMetadataParser.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public static function parseXML($xml, $entityId = null, $desiredNameIdFormat = n
140140
if ($sloNodes->length > 0) {
141141
$metadataInfo['idp']['singleLogoutService'] = array(
142142
'url' => $sloNodes->item(0)->getAttribute('Location'),
143+
'responseUrl' => $sloNodes->item(0)->getAttribute('ResponseLocation'),
143144
'binding' => $sloNodes->item(0)->getAttribute('Binding')
144145
);
145146
}

tests/data/metadata/idp/metadata.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ WQO0LPxPqRiUqUzyhDhLo/xXNrHCu4VbMw==</ds:X509Certificate>
6868
</ds:X509Data>
6969
</ds:KeyInfo>
7070
</KeyDescriptor>
71-
<SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://idp.examle.com/saml/slo"/>
71+
<SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://idp.examle.com/saml/slo" ResponseLocation="https://idp.examle.com/saml/slr"/>
7272
<NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</NameIDFormat>
7373
<SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://idp.examle.com/saml/sso"/>
7474
</IDPSSODescriptor>

tests/src/OneLogin/Saml2/IdPMetadataParserTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public function testParseFileXML()
2121
),
2222
'singleLogoutService' => array (
2323
'url' => 'https://example.onelogin.com/trust/saml2/http-redirect/slo/645460',
24+
'responseUrl' => '',
2425
'binding' => 'urn:oasis:names:tc:SAML:2.0:bindings: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biBJZFAxHzAdBgNVBAMMFk9uZUxvZ2luIEFjY291bnQgODkxNDaCFD8svwN22QGeJtvD8xFFKE+0SYcSMA4GA1UdDwEB/wQEAwIHgDANBgkqhkiG9w0BAQUFAAOCAQEAQhB4q9jrycwbHrDSoYR1X4LFFzvJ9Us75wQquRHXpdyS9D6HUBXMGI6ahPicXCQrfLgN8vzMIiqZqfySXXv/8/dxe/X4UsWLYKYJHDJmxXD5EmWTa65chjkeP1oJAc8f3CKCpcP2lOBTthbnk2fEVAeLHR4xNdQO0VvGXWO9BliYPpkYqUIBvlm+Fg9mF7AM/Uagq2503XXIE1Lq//HON68P10vNMwLSKOtYLsoTiCnuIKGJqG37MsZVjQ1ZPRcO+LSLkq0i91gFxrOrVCrgztX4JQi5XkvEsYZGIXXjwHqxTVyt3adZWQO0LPxPqRiUqUzyhDhLo/xXNrHCu4VbMw=='
@@ -70,6 +71,7 @@ public function testParseXML()
7071
),
7172
'singleLogoutService' => array (
7273
'url' => 'https://idp.examle.com/saml/slo',
74+
'responseUrl' => 'https://idp.examle.com/saml/slr',
7375
'binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'
7476
),
7577
'x509certMulti' => array (
@@ -180,6 +182,7 @@ public function testParseDesiredBindingAll()
180182
),
181183
"singleLogoutService" => array(
182184
"url" => "http://idp.example.com/logout",
185+
'responseUrl' => '',
183186
"binding" => "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
184187
)
185188
)
@@ -297,6 +300,7 @@ public function testParseMultiCerts()
297300
"idp" => array(
298301
"singleLogoutService" => array(
299302
"url" => "https://idp.examle.com/saml/slo",
303+
'responseUrl' => '',
300304
"binding" => "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
301305
),
302306
"x509certMulti" => array(
@@ -336,6 +340,7 @@ public function testParseMultiSigningCerts()
336340
"idp" => array(
337341
"singleLogoutService" => array(
338342
"url" => "https://idp.examle.com/saml/slo",
343+
'responseUrl' => '',
339344
"binding" => "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
340345
),
341346
"x509certMulti" => array(
@@ -424,6 +429,7 @@ public function testInjectIntoSettings()
424429
),
425430
'singleLogoutService' => array (
426431
'url' => 'http://stuff.com/endpoints/endpoints/sls.php'
432+
427433
),
428434
'NameIDFormat' => 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress'
429435
),
@@ -435,6 +441,7 @@ public function testInjectIntoSettings()
435441
),
436442
'singleLogoutService' => array (
437443
'url' => 'https://idp.adfs.example.com/adfs/ls/',
444+
'responseUrl' => '',
438445
'binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'
439446
),
440447
'x509certMulti' => array (

0 commit comments

Comments
 (0)