Repository navigation
Build the OpenID Connect sign-in into GrandNode and remove its plugin - #978
Merged
Merged
Conversation
added 6 commits
October 22, 2026 22:26
…ink the grid to the OpenID Connect card
added 2 commits
October 23, 2026 08:20
…ed and check the scheme before reading a back-channel logout
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.
Builds the OpenID Connect browser sign-in into GrandNode and removes the plugin
Authentication.OpenIdConnectType: feature
Issue
The browser sign-in with the identity provider lived in the plugin
Authentication.OpenIdConnect, but core already owned everything around it: the resource server, the account links, the provider sessions,SsoOnly,SignInMode = ProviderOnly, break-glass accounts and everyOidcLoginsetting in appsettings. Core even hard-coded the plugin's system name. As a result, a core security mode (ProviderOnly) worked only while a plugin was installed: uninstalling or disabling the plugin left only break-glass accounts able to sign in. The configuration was also split between appsettings and a plugin settings row that held a single value (DisplayOrder).OpenID Connect is a protocol, like cookie and JWT bearer authentication, so it belongs in core. Vendor-specific providers (Google, Facebook) stay plugins.
Solution
Grand.Web.Common/Security/Oidc: the handler builder, token refresher, RP-initiated sign-out, back-channel logout endpoint and logout-token validator, profile synchronizer, identity mapper, session data and theOidcLoginProvider.Grand.Web.Common/Startup/OidcLoginStartup. The provider, the token refresher and the sign-out provider are registered only whenOidcResourceServer:AuthorityandOidcLogin:ClientIdare set (OidcLoginConfig.IsConfigured). The HTTP client (no redirects), the logout-token validator (singleton) and the profile synchronizer are always registered, because their endpoints are always mapped. Lifetimes are the same as in the plugin. The startup priority is 502 (the plugin used 10); there is no ordering dependency.OidcLoginController(baseBaseControlleras before, so no public-store or closed-store filters were added), the view component, the viewsViews/OidcLogin/*(themes can now override them) and the modelsOidcFailedModel/OidcLinkModelare inGrand.Web. The routes are inGrand.Web/Endpoints/OidcLoginEndpointProvider. URLs are byte-identical and never take a language prefix:/signin-oidc,/oidc/login,/oidc/callback,/oidc/link,/oidc/link/complete,/oidc/failed,POST /oidc/backchannel-logout.ExternalAuth.OpenIdConnect, so existing account links, the link-id hash and "My account" work unchanged. The Active toggle in Configuration → External authentication still applies.DisplayOrdermoved to appsettings asOidcLogin:DisplayOrder(default 0).OidcSignInModeCheckno longer checks for an installed plugin. Log texts and comments that named the plugin are reworded.The logout token was refused), so an outsider cannot tell whether the feature is set up. The log names the reason.Plugins.ExternalAuth.OpenIdConnect.*becameAccount.Oidc.*(storefront) andAdmin.Plugins.ExternalAuthenticationMethods.Oidc.*(admin card). They are inDefaultLanguage.xmland inUpgrade/en_250.xml, which the existing 2.5 migration imports. No new migration: 2.5 is unreleased.docs/oidc-resource-server.mddescribes the built-in sign-in, with no plugin installation steps.Breaking changes
None for released versions: the plugin, its settings and its resource keys exist only on
develop(2.5).For a
developinstallation that had the plugin installed:src/Web/Grand.Web/Plugins/Authentication.OpenIdConnect/(see the note at the top).ExternalAuth.OpenIdConnectentry inApp_Data/InstalledPlugins.cfgis harmless and can be removed.OidcLoginSettingsclass is no longer read; setOidcLogin:DisplayOrderinstead.Account.Oidc.*keys untilApp_Data/Resources/Upgrade/en_250.xmlis imported again in Configuration → Languages → English → Import.Code:
OidcSignInModeCheck.Problemlost itsIEnumerable<PluginInfo>parameter, and the plugin types are gone (the moved ones now live inGrand.Web.Common.Security.Oidc).Testing
Unit tests: the solution builds.
Grand.Web.Common.Tests,Grand.Web.Tests,Grand.Web.Admin.Tests,Grand.Business.Authentication.TestsandGrand.Modules.Testspass. The plugin's tests moved with the code, and new tests coverOidcLoginStartup, the routes, the admin card and the unconfigured back-channel answer.OrderReportServiceTests.ProductsNeverSold_ExcludesSoldProducts(Checkout, not touched here) can fail in a full parallel run and passes alone; a cleandeveloprun shows the same kind of flake.End to end (done on Keycloak 26.8):
src/Web/Grand.Web/Plugins/Authentication.OpenIdConnect/and build the solution. Start the store withOidcResourceServer:Enabled=true,OidcResourceServer:Authority=<realm URL>,OidcLogin:ClientId,OidcLogin:ClientSecretand, for the full flow,OidcLogin:SignInMode=ProviderOnlywith oneOidcLogin:BreakGlassAccountsentry. Expected: no "Scheme already exists" and no "ProviderOnly sign-in mode without a working OpenID Connect login" error in the log./loginredirects to the provider; signing in there returns to the store signed in. A user with an unverified e-mail ends on/oidc/failed./admin/login?password=1signs in the break-glass account only.http(s)://<store>/oidc/backchannel-logoutat the provider and sign a user out there (Keycloak: Users → Sessions → Sign out). The user's store session ends; the log hasBack-channel logout: 1 session(s) ended.OidcLogin:ClientIdand restart. There is no provider button and no grid row, and/oidc/loginredirects to/oidc/failed.POST /oidc/backchannel-logoutanswers 400The logout token was refused.