Skip to content

Commit 0951e47

Browse files
authored
Merge pull request #1155 from nextcloud/fix/noid/sso-logout-no-session-data
Make sure to logout in the IdP when single-logout didn't find the provider
2 parents 885ceb3 + 23e38a4 commit 0951e47

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lib/Controller/LoginController.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use OCA\UserOIDC\Service\OIDCService;
2727
use OCA\UserOIDC\Service\ProviderService;
2828
use OCA\UserOIDC\Service\ProvisioningService;
29+
use OCA\UserOIDC\Service\SettingsService;
2930
use OCA\UserOIDC\Service\TokenService;
3031
use OCA\UserOIDC\User\Backend;
3132
use OCA\UserOIDC\Vendor\Firebase\JWT\JWT;
@@ -70,6 +71,7 @@ public function __construct(
7071
private ProviderService $providerService,
7172
private DiscoveryService $discoveryService,
7273
private LdapService $ldapService,
74+
private SettingsService $settingsService,
7375
private ISecureRandom $random,
7476
private ISession $session,
7577
private HttpClientHelper $clientService,
@@ -667,6 +669,13 @@ public function singleLogoutService() {
667669
}
668670
} else {
669671
$providerId = $this->session->get(self::PROVIDERID);
672+
// if the provider is not found and we are in SSO mode, just use the one and only provider
673+
if ($providerId === null && !$this->settingsService->getAllowMultipleUserBackEnds()) {
674+
$providers = $this->providerMapper->getProviders();
675+
if (count($providers) === 1) {
676+
$providerId = $providers[0]->getId();
677+
}
678+
}
670679
}
671680
if ($providerId) {
672681
try {

0 commit comments

Comments
 (0)