Loading lib/Service/SSOService.php +1 −10 Original line number Diff line number Diff line Loading @@ -119,13 +119,10 @@ class SSOService { $this->callSSOAPI($url, 'POST', [], 204); // Revoke offline sessions for all clients $this->logger->debug('Starting offline session revocation for user: ' . $username); try { $this->revokeOfflineSessionsForUser(); $this->logger->debug('Offline session revocation completed successfully for user: ' . $username); } catch (\Exception $e) { $this->logger->warning('Failed to revoke offline sessions: ' . $e->getMessage()); // Don't throw the exception - offline session revocation is not critical for logout } } Loading @@ -133,15 +130,12 @@ class SSOService { * Revoke all offline sessions for the current user in Keycloak */ private function revokeOfflineSessionsForUser(): void { $this->logger->debug('Starting offline session revocation process for user ID: ' . $this->currentUserId); try { $clients = $this->getClientsForRealm(); if (empty($clients)) { $this->logger->debug('No clients found for offline session revocation'); return; } $this->logger->debug('Found ' . count($clients) . ' clients to process for offline session revocation'); foreach ($clients as $client) { try { $this->revokeOfflineSessionsForClient($client); Loading @@ -150,7 +144,6 @@ class SSOService { // Continue with other clients even if one fails } } $this->logger->debug('Offline session revocation process completed for user ID: ' . $this->currentUserId); } catch (\Exception $e) { $this->logger->warning('Failed to get clients for offline session revocation: ' . $e->getMessage()); } Loading Loading @@ -182,10 +175,9 @@ class SSOService { return []; } // Cache the clients for 6 hours (serialize to JSON string) // Cache the clients for 24 hours (converted to JSON string) $clientsJson = json_encode($clients); $this->clientsCache->set($cacheKey, $clientsJson, self::CLIENTS_CACHE_TTL); $this->logger->debug('Cached ' . count($clients) . ' clients in distributed cache for 6 hours'); return $clients; } catch (\Exception $e) { Loading Loading @@ -249,7 +241,6 @@ class SSOService { $deleteSessionUrl = $this->ssoConfig['admin_rest_api_url'] . '/sessions/' . $sessionId . '?isOffline=true'; try { $this->logger->info('Deleting offline session: ' . $sessionId); $this->callSSOAPI($deleteSessionUrl, 'DELETE', [], 204); } catch (\Exception $e) { $this->logger->error('Failed to delete offline session ' . $sessionId . ': ' . $e->getMessage()); Loading Loading
lib/Service/SSOService.php +1 −10 Original line number Diff line number Diff line Loading @@ -119,13 +119,10 @@ class SSOService { $this->callSSOAPI($url, 'POST', [], 204); // Revoke offline sessions for all clients $this->logger->debug('Starting offline session revocation for user: ' . $username); try { $this->revokeOfflineSessionsForUser(); $this->logger->debug('Offline session revocation completed successfully for user: ' . $username); } catch (\Exception $e) { $this->logger->warning('Failed to revoke offline sessions: ' . $e->getMessage()); // Don't throw the exception - offline session revocation is not critical for logout } } Loading @@ -133,15 +130,12 @@ class SSOService { * Revoke all offline sessions for the current user in Keycloak */ private function revokeOfflineSessionsForUser(): void { $this->logger->debug('Starting offline session revocation process for user ID: ' . $this->currentUserId); try { $clients = $this->getClientsForRealm(); if (empty($clients)) { $this->logger->debug('No clients found for offline session revocation'); return; } $this->logger->debug('Found ' . count($clients) . ' clients to process for offline session revocation'); foreach ($clients as $client) { try { $this->revokeOfflineSessionsForClient($client); Loading @@ -150,7 +144,6 @@ class SSOService { // Continue with other clients even if one fails } } $this->logger->debug('Offline session revocation process completed for user ID: ' . $this->currentUserId); } catch (\Exception $e) { $this->logger->warning('Failed to get clients for offline session revocation: ' . $e->getMessage()); } Loading Loading @@ -182,10 +175,9 @@ class SSOService { return []; } // Cache the clients for 6 hours (serialize to JSON string) // Cache the clients for 24 hours (converted to JSON string) $clientsJson = json_encode($clients); $this->clientsCache->set($cacheKey, $clientsJson, self::CLIENTS_CACHE_TTL); $this->logger->debug('Cached ' . count($clients) . ' clients in distributed cache for 6 hours'); return $clients; } catch (\Exception $e) { Loading Loading @@ -249,7 +241,6 @@ class SSOService { $deleteSessionUrl = $this->ssoConfig['admin_rest_api_url'] . '/sessions/' . $sessionId . '?isOffline=true'; try { $this->logger->info('Deleting offline session: ' . $sessionId); $this->callSSOAPI($deleteSessionUrl, 'DELETE', [], 204); } catch (\Exception $e) { $this->logger->error('Failed to delete offline session ' . $sessionId . ': ' . $e->getMessage()); Loading