Repository navigation
feat: log in with an OIDC provider - #273
Draft
DavidePrincipi wants to merge 3 commits into
Draft
DavidePrincipi wants to merge 3 commits into
DavidePrincipi wants to merge 3 commits into
Conversation
When the oidc.env file of the module state holds the issuer and the client credentials, the app service start configures the user_oidc app: the login page offers the OIDC provider next to the password form, or redirects to it. The ldap_uuid claim is the Nextcloud user ID, as user_ldap assigns it, so OIDC logins map to the existing LDAP accounts and no other account is created. The LDAP login filter also matches the UUID: user_oidc uses it to resolve users not mapped by user_ldap yet, who otherwise could not log in at the first try. The settings are written manually for now: provider discovery comes later. The file is part of the backup, because it holds the client secret. Assisted-by: Claude Code:claude-opus-5-5
This was referenced Oct 2, 2026
The OIDC provider refused the redirect back to Nextcloud after the logout, because the client had no post-logout redirect URI. Set the post-logout URI of the user_oidc provider to the Nextcloud home page explicitly, and register the same URI in the README example. Assisted-by: Claude Code:claude-opus-5-5
OIDC_LOGIN_MODE in the module environment replaces the boolean in the secrets file. optional keeps the password form next to the SSO button, exclusive sends the login page straight to the provider; an unknown value works as optional, with a warning. The provider name moves to the module environment too: oidc.env keeps only the client secrets. The README documents the emergency password form at /login?direct=1, the access that keeps using LDAP passwords, and why a realm that accepts only federated logins needs the exclusive mode. Assisted-by: Claude Code:claude-opus-5-5
This branch has not been deployed
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.
Let Nextcloud users log in with single sign-on (SSO) through an OpenID Connect (OIDC) provider, like the Keycloak realm of their user domain in the new idp module, as part of NethServer/dev#8080.
When OIDC is configured, the Nextcloud login page offers the provider login, and an OIDC login opens the existing LDAP account of the user: no new account is created. Without OIDC settings nothing changes. For now the settings are written by hand: discovery of the provider comes later.
setup-oidcscript, run at every start of the app service: it enables and configures theuser_oidcapp, or disables it without settingsldap_uuidclaim of the token is the Nextcloud user ID, and the LDAP login filter also matches the account UUIDstate/oidc.env(OIDC_ISSUER,OIDC_CLIENT_ID,OIDC_CLIENT_SECRET), mode 0600 and included in the backup; the login mode in the module environment:OIDC_LOGIN_MODE=optionalshows the Nextcloud form with the SSO button,exclusivegoes straight to the provider, with/login?direct=1as emergency password login. All documented in the README, together with the logout URI to registerHow to test
register-clientaction of the idp module, and write its credentials tostate/oidc.envas the README showsOIDC_LOGIN_MODE=exclusive, restart, and check that the login page goes straight to the provider, while/login?direct=1still shows the password formstate/oidc.env, restart, and check that the password login works as beforeSee also
Generated by Claude Code:claude-opus-5-5 with nethserver-pr