Handle failing SLO

If the SLO throws an error we should catch it. This is so that we do not
show an error page. We should also still logout the current session.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2020-09-25 09:26:37 +02:00
parent ca771d401b
commit 160ad27474
No known key found for this signature in database
GPG key ID: F941078878347C0C

View file

@ -406,7 +406,12 @@ class SAMLController extends Controller {
$nameIdNameQualifier = $this->session->get('user_saml.samlNameIdNameQualifier');
$nameIdSPNameQualifier = $this->session->get('user_saml.samlNameIdSPNameQualifier');
$sessionIndex = $this->session->get('user_saml.samlSessionIndex');
$targetUrl = $auth->logout(null, [], $nameId, $sessionIndex, $stay, $nameIdFormat, $nameIdNameQualifier, $nameIdSPNameQualifier);
try {
$targetUrl = $auth->logout(null, [], $nameId, $sessionIndex, $stay, $nameIdFormat, $nameIdNameQualifier, $nameIdSPNameQualifier);
} catch (Error $e) {
$this->logger->logException($e, ['level' => ILogger::WARN]);
$this->userSession->logout();
}
}
if(!empty($targetUrl) && !$auth->getLastErrorReason()){
$this->userSession->logout();