From e5dec7eceb90ccc3cfedd7232159c0f5374e4cfa Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Thu, 20 Apr 2023 12:43:38 -0100 Subject: [PATCH] pass idp to sls Signed-off-by: Maxence Lange --- lib/Controller/MasterController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Controller/MasterController.php b/lib/Controller/MasterController.php index 9df65f3..2e89e3f 100644 --- a/lib/Controller/MasterController.php +++ b/lib/Controller/MasterController.php @@ -79,15 +79,16 @@ public function __construct( */ public function autoLogout(?string $jwt) { try { - if ($jwt !== null && $this->master->isValidJwt($jwt)) { + if ($jwt !== null) { $key = $this->gss->getJwtKey(); $decoded = (array)JWT::decode($jwt, new Key($key, Application::JWT_ALGORITHM)); - $idp = $decoded['saml.idp'] ?? null; + $logoutUrl = $this->urlGenerator->linkToRoute('user_saml.SAML.singleLogoutService'); - if (!empty($logoutUrl) && $idp !== null) { + if (!empty($logoutUrl)) { $token = [ 'logout' => 'logout', + 'idp' => $idp, 'exp' => time() + 300, // expires after 5 minutes ];