fix(theme): request 'groups' OIDC scope in OpenCloud theme#1
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Override
openIdConnectScopes()inOpenCloudThemeto request thegroupsscope alongside the defaultopenid offline_access email profileset. BaseTheme::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
groupsscope in the desktop's OAuth request, Authelia (and default Keycloak / Authentik) won't emit thegroupsclaim β server-side role mapping then fails with: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_SCOPESenv is honoured for the web frontend, but the desktop client hardcodes its own scope list and ignores the server.Tradeoffs
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
~/opencloud/desktop-issue-001-oidc-scopes.mdTest plan
adminsAuthelia groupusersgroup only β maps touserrole, notadminπ€ 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
groupsscope in addition to the defaultopenid offline_access email profileset, via a newOpenCloudTheme::openIdConnectScopes()override.That lets scope-gated identity providers (e.g. Authelia, default Keycloak/Authentik) include a
groupsclaim so OpenCloud can map roles server-side. Without it, desktop login can fail after OAuth with missing roles in user claims. The baseThemedefault 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.