4.3.0
What's New
RegistrationGuard SPI
A new Service Provider Interface for gating user registration across all registration paths (form, passwordless, OAuth2, OIDC). Implement RegistrationGuard to add custom pre-registration logic like invite-only access, domain whitelisting, or rate limiting.
RegistrationGuardinterface with@FunctionalInterfacesupport for lambda implementationsRegistrationContextrecord providing email, source, and provider nameRegistrationDecisionrecord withallow()/deny(reason)factory methods- Default permit-all guard auto-configured via
@ConditionalOnMissingBean - Full documentation in
REGISTRATION-GUARD.md
OIDC Service Alignment
Fixed four inconsistencies in DSOidcUserService to match DSOAuth2UserService behavior:
- Email normalization: Email lookup now uses
trim().toLowerCase(Locale.ROOT)beforefindByEmail(), preventing case-sensitive and locale-dependent mismatches - Audit events: New OIDC user registration now publishes an
"OIDC Registration Success"audit event - Transactional boundaries: Added
@Transactionalat class level for proper database operation handling - Login helper integration:
loadUser()now routes throughLoginHelperService.userLoginHelper()to updatelastActivityDateand run lockout checks
Additional Improvements
DSUserDetailsremains immutable — OIDC tokens are set via a newLoginHelperServiceoverload rather than mutable settersOAuth2Errornow includes the denial reason in the error description field for programmatic access byAuthenticationFailureHandlerimplementations- Audit events are published after
save()to prevent false-positive audit records if persistence fails RegistrationDecision.deny()usesString.isBlank()(Java 17+) and a namedDEFAULT_DENIAL_REASONconstant