Skip to content

Commit ee4f938

Browse files
committed
Bugfix: Set destination on signed LogoutResponse for POST and Redirect bindings
1 parent 4fcd5e1 commit ee4f938

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modules/saml/src/Controller/ServiceProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,9 @@ public function singleLogoutService(Request $request, string $sourceId): Respons
566566
$lr->setRelayState($message->getRelayState());
567567
$lr->setInResponseTo($message->getId());
568568

569+
// If we set a key, we're sending a signed message
570+
$signedMessage = $lr->getSignatureKey() ? true : false;
571+
569572
if ($numLoggedOut < count($sessionIndexes)) {
570573
Logger::warning('Logged out of ' . $numLoggedOut . ' of ' . count($sessionIndexes) . ' sessions.');
571574
}
@@ -578,17 +581,14 @@ public function singleLogoutService(Request $request, string $sourceId): Respons
578581
]
579582
);
580583

584+
$dst = $dst['Location'];
581585
if (!($binding instanceof SOAP)) {
582586
$binding = Binding::getBinding($dst['Binding']);
583587
if (isset($dst['ResponseLocation'])) {
584588
$dst = $dst['ResponseLocation'];
585-
} else {
586-
$dst = $dst['Location'];
587589
}
588-
$binding->setDestination($dst);
589-
} else {
590-
$lr->setDestination($dst['Location']);
591590
}
591+
$lr->setDestination($dst);
592592

593593
$psrResponse = $binding->send($lr);
594594
$httpFoundationFactory = new HttpFoundationFactory();

0 commit comments

Comments
 (0)