Repository navigation
Provider-only sign-in mode: one sign-in policy per surface, break-glass accounts - #907
Merged
Merged
Conversation
…n the sign-in policy
…t with where the password is used
…n in ProviderOnly, assert surfaces in tests
…-verified e-mail, refuse an unverified one
…s sent to a change-password page it cannot use
… switch stop working at once (API users, Frontend API registered customers); guest tokens stay
… unknown provider user at the first sign-in, without the registration form
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.
Resolves no public issue
Type: feature
Issue
Installations that run GrandNode behind a company single sign-on need the identity provider to be the only way to sign in. Today every password path (storefront, Store/Vendor/Admin panels, Frontend API, legacy API users, password recovery, cookie validation, token refresh) decides with
IExternalSignInPolicy.RequiredProvider, which knows nothing about where the password is used and cannot keep a short list of emergency administrator accounts.First of four stacked pull requests for the provider-only sign-in mode (core → web → plugin → guide).
Solution
OidcLogin:SignInMode=Mixed(default, unchanged behaviour) |ProviderOnly, andOidcLogin:BreakGlassAccounts(e-mails, trimmed, case-insensitive).IExternalSignInPolicy.PasswordSignIn(customer, SignInSurface)replacesRequiredProvider. InProviderOnlyevery password is refused except break-glass accounts on the Admin panel; when the OpenID Connect login is not installed, active or configured the policy fails closed (only break-glass) and logs an error at most every five minutes. Accepted break-glass sign-ins are logged as warnings.LoginCustomer, password recovery (storefront and panels), cookie validation, Frontend API login and refresh (guest tokens unaffected). Legacy API users are refused inProviderOnly.ProviderOnly(no account is sent to a change-password page it cannot use).OidcLoginRefusal.EmailNotVerified). Links made by e-mail are not re-checked while the mode is on; switching back toMixedrestores the earlier rules.ProviderOnly(the stored setting is not changed).ProviderOnlyis set without a configured, installed OpenID Connect login.Breaking changes
IExternalSignInPolicy.RequiredProvideris replaced byPasswordSignIn(Customer, SignInSurface);ICustomerManagerService.LoginCustomergains an optionalsurfaceparameter. Behaviour inMixedis unchanged.Testing
dotnet test GrandNode.slnx(new tests: sign-in policy per surface and mode, break-glass list, resolver linking, startup check, guest checkout helper, password expiry, bearer token checks).OidcLogin:SignInMode=ProviderOnlyandBreakGlassAccounts=[admin e-mail]: password sign-in on the storefront and panels is refused; the break-glass account signs in on the Admin panel and a warning is logged;/api/token/createand the Frontend API password login are refused.