Skip to content

fix(theme): request 'groups' OIDC scope in OpenCloud theme#1

Merged
KaroUniform merged 1 commit into
mainfrom
fix/oidc-scopes-groups
May 26, 2026
Merged

fix(theme): request 'groups' OIDC scope in OpenCloud theme#1
KaroUniform merged 1 commit into
mainfrom
fix/oidc-scopes-groups

Conversation

@KaroUniform
Copy link
Copy Markdown
Owner

@KaroUniform KaroUniform commented May 26, 2026

Summary

Override openIdConnectScopes() in OpenCloudTheme to request the groups scope alongside the default openid offline_access email profile set. Base Theme::openIdConnectScopes() is unchanged, so the ownCloud-branded code path keeps its historical defaults.

Why

Stopgap for our drive.karouniform.xyz setup (OpenCloud 7.0.0 + Authelia 4.39.19, role mapping via PROXY_ROLE_ASSIGNMENT_OIDC_CLAIM=groups).

Without the groups scope in the desktop's OAuth request, Authelia (and default Keycloak / Authentik) won't emit the groups claim β€” server-side role mapping then fails with:

proxy: "no roles in user claims" β€” Error mapping role names to role ids

The login dies on the post-OAuth user-info step with "Failed to get user info from server".

Web login works because the OpenCloud server's OC_OIDC_CLIENT_SCOPES env is honoured for the web frontend, but the desktop client hardcodes its own scope list and ignores the server.

Tradeoffs

  • IDPs that reject unknown scopes (some older Auth0 setups) will break for us β€” we accept this since our IDP is Authelia and the upstream architectural fix (opencloud-eu/desktop#847) isn't merging soon.
  • This is NOT intended for upstreaming to opencloud-eu/desktop β€” the maintainer (@kaivol) explicitly rejects hardcoded scopes in #217. The right long-term fix is webfinger-based discovery, see PR #847.

References

Test plan

  • Build locally on macOS (Qt6 + CMake)
  • Reproduce: log in with unmodified upstream binary against drive.karouniform.xyz β†’ confirm "Failed to get user info from server"
  • Apply this branch's build, log in β†’ expect success with admin role visible for user in admins Authelia group
  • Cross-check with user in users group only β†’ maps to user role, not admin

πŸ€– Generated with Claude Code


Note

Medium Risk
Changes OAuth authorization scope for the OpenCloud theme only; IDPs that reject unknown scopes could break login, while fixing group-claim-dependent role mapping.

Overview
OpenCloud-branded desktop OAuth now requests the groups scope in addition to the default openid offline_access email profile set, via a new OpenCloudTheme::openIdConnectScopes() override.

That lets scope-gated identity providers (e.g. Authelia, default Keycloak/Authentik) include a groups claim so OpenCloud can map roles server-side. Without it, desktop login can fail after OAuth with missing roles in user claims. The base Theme default is unchanged, so other themes keep the previous scope list.

Reviewed by Cursor Bugbot for commit 3b82d48. Bugbot is set up for automated code reviews on this repo. Configure here.

Override openIdConnectScopes() in OpenCloudTheme to include the
"groups" scope alongside the default openid/offline_access/email/profile
set.

IDPs that scope-gate their group claim (Authelia, Keycloak and Authentik
in default config) only emit it when the corresponding scope is requested
in the authorization request. Without it, server-side role mapping via
PROXY_ROLE_ASSIGNMENT_OIDC_CLAIM=groups fails with "no roles in user
claims" and login dies on the post-OAuth user-info step with "Failed to
get user info from server".

Stopgap until opencloud-eu#847 (webfinger-based OIDC parameter discovery) lands
upstream. Refs opencloud-eu#217.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@KaroUniform KaroUniform merged commit 6d10b9d into main May 26, 2026
1 check passed
@KaroUniform KaroUniform deleted the fix/oidc-scopes-groups branch May 26, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant