|
26 | 26 | use OCA\UserOIDC\Service\OIDCService; |
27 | 27 | use OCA\UserOIDC\Service\ProviderService; |
28 | 28 | use OCA\UserOIDC\Service\ProvisioningService; |
| 29 | +use OCA\UserOIDC\Service\SettingsService; |
29 | 30 | use OCA\UserOIDC\Service\TokenService; |
30 | 31 | use OCA\UserOIDC\User\Backend; |
31 | 32 | use OCA\UserOIDC\Vendor\Firebase\JWT\JWT; |
@@ -70,6 +71,7 @@ public function __construct( |
70 | 71 | private ProviderService $providerService, |
71 | 72 | private DiscoveryService $discoveryService, |
72 | 73 | private LdapService $ldapService, |
| 74 | + private SettingsService $settingsService, |
73 | 75 | private ISecureRandom $random, |
74 | 76 | private ISession $session, |
75 | 77 | private HttpClientHelper $clientService, |
@@ -667,6 +669,13 @@ public function singleLogoutService() { |
667 | 669 | } |
668 | 670 | } else { |
669 | 671 | $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 | + } |
670 | 679 | } |
671 | 680 | if ($providerId) { |
672 | 681 | try { |
|
0 commit comments