Description
The desktoplogin value in lib/PublicCapabilities.php is hardcoded to 1:
This prevents the Nextcloud desktop client from using the standard OIDC login flow (via user_oidc) on GSS slave nodes. When desktoplogin is 1, the desktop client's WebView opens /index.php/login/flow, but the OIDC authentication callback never produces the nc://login/server:...&user:...&password:... URL that the client expects.
Steps to reproduce
- Configure a GSS slave node with
globalsiteselector 2.7.0 enabled
- Enable
user_oidc 8.8.0 on the same node with a working OIDC provider (e.g. Keycloak)
- Confirm that OIDC login works fine in a web browser
- Try to add the account in the Nextcloud desktop client (tested with 4.0.7, Qt 6.10.2)
- In the WebView, authenticate via OIDC/FIM
Expected: The OIDC flow completes and the desktop client receives credentials via nc:// callback
Actual: The WebView stays open after OIDC authentication completes. No nc:// callback is triggered. The client log shows:
Auth type for QUrl("https://slave.example.com/remote.php/dav/files//") is OCC::DetermineAuthTypeJob::WebViewFlow
Url to auth at: "https://slave.example.com/index.php/login/flow"
The globalscale capability returned to the client is:
{"enabled": true, "desktoplogin": 1, "token": "xxxxx"}
Workaround
Manually patch lib/PublicCapabilities.php to set desktoplogin to 0. This makes the desktop client fall back to the standard OIDC login flow, which works correctly.
Proposed fix
Inject IAppConfig and read the value from app config instead of hardcoding it:
--- a/lib/PublicCapabilities.php
+++ b/lib/PublicCapabilities.php
@@ -10,17 +10,19 @@
use OCA\GlobalSiteSelector\Service\GlobalScaleService;
use OCP\Capabilities\IPublicCapability;
+use OCP\IAppConfig;
class PublicCapabilities implements IPublicCapability {
public function __construct(
private readonly GlobalScaleService $globalScaleService,
+ private readonly IAppConfig $appConfig,
) {
}
public function getCapabilities(): array {
return [
'globalscale' => [
'enabled' => true,
- 'desktoplogin' => 1,
+ 'desktoplogin' => $this->appConfig->getValueInt('globalsiteselector', 'desktoplogin', 1),
'token' => $this->globalScaleService->getLocalToken(),
]
];
This allows administrators to control the behavior via:
occ config:app:set globalsiteselector desktoplogin --value=0
Environment
- Nextcloud Server: 32.0.6 Enterprise
- Global Site Selector: 2.7.0
- user_oidc: 8.8.0
- Desktop client: 4.0.7 (Qt 6.10.2, Linux)
- OIDC Provider: Keycloak
Description
The
desktoploginvalue inlib/PublicCapabilities.phpis hardcoded to1:This prevents the Nextcloud desktop client from using the standard OIDC login flow (via
user_oidc) on GSS slave nodes. Whendesktoploginis1, the desktop client's WebView opens/index.php/login/flow, but the OIDC authentication callback never produces thenc://login/server:...&user:...&password:...URL that the client expects.Steps to reproduce
globalsiteselector2.7.0 enableduser_oidc8.8.0 on the same node with a working OIDC provider (e.g. Keycloak)Expected: The OIDC flow completes and the desktop client receives credentials via
nc://callbackActual: The WebView stays open after OIDC authentication completes. No
nc://callback is triggered. The client log shows:The
globalscalecapability returned to the client is:{"enabled": true, "desktoplogin": 1, "token": "xxxxx"}Workaround
Manually patch
lib/PublicCapabilities.phpto setdesktoploginto0. This makes the desktop client fall back to the standard OIDC login flow, which works correctly.Proposed fix
Inject
IAppConfigand read the value from app config instead of hardcoding it:This allows administrators to control the behavior via:
Environment