Skip to content
Snippets Groups Projects
Commit 38f7bcbe authored by Jaime Pérez Crespo's avatar Jaime Pérez Crespo
Browse files

Make SimpleSAML_Configuration::getDefaultEndpoint to prioritize certain...

Make SimpleSAML_Configuration::getDefaultEndpoint to prioritize certain bindings for SingleLogoutService endpoints.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3300 44740490-163a-0410-bde0-09ae8108e29a
parent 22579cec
No related branches found
No related tags found
No related merge requests found
...@@ -995,6 +995,31 @@ class SimpleSAML_Configuration { ...@@ -995,6 +995,31 @@ class SimpleSAML_Configuration {
assert('is_string($endpointType)'); assert('is_string($endpointType)');
$endpoints = $this->getEndpoints($endpointType); $endpoints = $this->getEndpoints($endpointType);
// SingleLogoutService is not an IndexedEndpointType, so we are free to choose the default.
if ($endpointType === "SingleLogoutService") {
$eps = array();
foreach ($endpoints as $ep) {
if ($bindings !== NULL && !in_array($ep['Binding'], $bindings, TRUE)) {
/* Unsupported binding. Skip it. */
continue;
}
$eps[$ep['Binding']] = $ep;
}
// We will apply the following order:
// 1st: SAML2_Const::BINDING_SOAP
// 2nd: SAML2_Const::BINDING_HTTP_REDIRECT
if (isset($eps[SAML2_Const::BINDING_SOAP])) {
return $eps[SAML2_Const::BINDING_SOAP];
}
if (isset($eps[SAML2_Const::BINDING_HTTP_REDIRECT])) {
return $eps[SAML2_Const::BINDING_HTTP_REDIRECT];
}
}
$defaultEndpoint = SimpleSAML_Utilities::getDefaultEndpoint($endpoints, $bindings); $defaultEndpoint = SimpleSAML_Utilities::getDefaultEndpoint($endpoints, $bindings);
if ($defaultEndpoint !== NULL) { if ($defaultEndpoint !== NULL) {
return $defaultEndpoint; return $defaultEndpoint;
......
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