Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

SpringUserFramework

> 后端框架
Open source

Easy User Management Framework/Starter App for Spring. Providing registration, login, logout, and more built on top of Spring Security.

189 stars0 likes1 views
WebsiteGitHub

About

Easy User Management Framework/Starter App for Spring. Providing registration, login, logout, and more built on top of Spring Security.

Spring User Framework

A comprehensive Spring Boot User Management Framework that simplifies the implementation of robust user authentication and management features. Built on top of Spring Security, this library provides ready-to-use solutions for user registration, login, account management, and more.

Check out the Spring User Framework Demo Application for a complete example of how to use this library.

Table of Contents

  • Spring User Framework
    • Table of Contents
    • Features
    • Installation
      • Spring Boot 4.x (Latest)
        • Spring Boot 4.x Key Changes
      • Spring Boot 3.5 (Stable)
    • Migration Guide
    • Quick Start
      • Prerequisites
      • Step 1: Add Dependencies
      • Step 2: Database Configuration
      • Step 3: JPA Configuration
      • Step 4: Email Configuration (Optional but Recommended)
      • Step 5: Essential Framework Configuration
      • Step 6: Create User Profile Extension (Optional)
      • Step 7: Start Your Application
      • Step 8: Test Core Features
      • Step 9: Customize Pages (Required for user-facing pages)
      • Complete Example Configuration
      • Next Steps
    • Configuration
    • Security Features
      • Role-Based Access Control
      • Account Lockout
      • Audit Logging
      • HTMX Support
      • CAPTCHA Protection (Cloudflare Turnstile)
    • User Management
      • Registration
      • Profile Management
      • Admin Password Reset
    • Email Verification
    • Authentication
      • Local Authentication
      • WebAuthn / Passkeys
      • OAuth2/SSO
        • SSO OIDC with Keycloak
    • Extensibility
      • Custom User Profiles
      • Handling User Account Deletion and Profile Cleanup
        • Enabling Actual Deletion
      • SSO OAuth2 with Google and Facebook
    • GDPR Compliance
      • Enabling GDPR Features
      • Data Export (Right of Access)
      • Account Deletion (Right to be Forgotten)
      • Consent Management
      • Extending GDPR Exports
      • GDPR Events
    • Examples
    • Contributing
    • Reference Documentation
    • License

Features

  • User Registration and Authentication

    • Registration, with optional email verification.
    • Login and logout functionality.
    • Forgot password flow.
    • Admin-initiated password reset with optional session invalidation.
    • Database-backed user store using Spring JPA.
    • SSO support for Google
    • SSO support for Facebook
    • SSO support for Keycloak
    • WebAuthn/Passkey support for passwordless login (biometrics, security keys, device authentication)
    • Configuration options to control anonymous access, whitelist URIs, and protect specific URIs requiring a logged-in user session.
    • CSRF protection enabled by default, with example jQuery AJAX calls passing the CSRF token from the Thymeleaf page context.
    • Audit event framework for recording and logging security events, customizable to store audit events in a database or publish them via a REST API.
    • Role and Privilege setup service to define roles, associated privileges, and role inheritance hierarchy using application.yml.
    • Configurable Account Lockout after too many failed login attempts
    • HTMX-aware session expiry handling — returns 401 JSON instead of 302 redirect for HTMX requests, preventing broken UI fragments
  • Advanced Security

    • Role and privilege-based authorization
    • Configurable password policies
    • Account lockout after failed login attempts
    • Audit logging for security events
    • CSRF protection out of the box
    • WebAuthn/Passkey credential management (register, rename, delete)
  • Extensible Architecture

    • Easily extend user profiles with custom data
    • Override default behaviors where needed
    • Integration with Spring ecosystem
    • Customizable UI templates
  • Developer-Friendly

    • Minimal boilerplate code to get started
    • Configuration-driven features
    • Comprehensive documentation
    • Demo application for reference
    • Built-in dev login controller for quick user switching during local development
  • GDPR Compliance (opt-in)

    • Data export (Right of Access - Article 15)
    • Account deletion (Right to be Forgotten - Article 17)
    • Consent tracking and management (Article 7)
    • Extensible data contributor system for custom data
    • Audit trail for all GDPR operations

Installation

Choose the version that matches your Spring Boot version:

Spring Boot Version Framework Version Java Version Spring Security
4.0.x – 4.1.x 5.3.x 21+ 7.x
3.5.x 3.6.x 17+ 6.x

Versioning note: This library follows Semantic Versioning for its own API; its major version is intentionally not aligned with Spring Boot's major version. The 5.3.x line is built and verified against Spring Boot 4.1.0 and also runs on 4.0.x — all Spring Boot starters are compileOnly, so your application picks the exact Spring Boot patch version. The 5.0.x line is a breaking release over 4.4.x; read the Migration Guide ("Migrating to 5.0.x") before upgrading — note especially the reverse-proxy user.security.appUrl requirement.

Spring Boot 4.x (Latest)

Spring Boot 4.x brings significant changes including Spring Security 7 and requires Java 21. The 5.x line is built and verified against Spring Boot 4.1.0 and is compatible with 4.0.x.

Maven:

xml

    com.digitalsanctuary
    ds-spring-user-framework
    5.3.4

Gradle:

groovy
implementation 'com.digitalsanctuary:ds-spring-user-framework:5.3.4'

Spring Boot 4.x Key Changes

When upgrading to Spring Boot 4.0, be aware of these important changes:

  • Java 21 Required: Spring Boot 4.0 requires Java 21 or higher
  • Spring Security 7: Includes breaking changes from Spring Security 6.x
    • All URL patterns in security configuration must start with /
    • Some deprecated APIs have been removed
  • Jackson 3: JSON processing uses Jackson 3.x with some API changes
  • Modular Test Infrastructure: Test annotations have moved to new packages:
    • @AutoConfigureMockMvc → org.springframework.boot.webmvc.test.autoconfigure
    • @DataJpaTest → org.springframework.boot.data.jpa.test.autoconfigure
    • @WebMvcTest → org.springframework.boot.webmvc.test.autoconfigure

For testing, you may need these additional dependencies:

groovy
testImplementation 'org.springframework.boot:spring-boot-data-jpa-test'
testImplementation 'org.springframework.boot:spring-boot-webmvc-test'
testImplementation 'org.springframework.boot:spring-boot-starter-security-test'

Upgrading from 3.x, or from 4.4.x? See the Migration Guide for detailed upgrade instructions. The 4.4.x → 5.0.x jump is a breaking release (security, schema, API, and auto-configuration changes) — review "Migrating to 5.0.x" before upgrading.

Spring Boot 3.5 (Stable)

For projects using Spring Boot 3.5.x with Java 17+:

Security-maintenance only. The 3.6.x line backports security fixes from the 5.x line that apply to Spring Boot 3.5; new feature development happens on 5.3.x. If you are on Java 21 / Spring Boot 4, use 5.3.x.

Maven:

xml

    com.digitalsanctuary
    ds-spring-user-framework
    3.6.0

Gradle:

groovy
implementation 'com.digitalsanctuary:ds-spring-user-framework:3.6.0'

Migration Guide

If you're upgrading from a previous version, see the Migration Guide for:

  • Step-by-step upgrade instructions
  • Breaking changes and how to address them
  • Spring Security 7 compatibility requirements
  • Test infrastructure changes
  • Guidance for developers extending the framework

Quick Start

Follow these steps to get up and running with the Spring User Framework in your application.

Prerequisites

  • For Spring Boot 4.0: Java 21 or higher
  • For Spring Boot 3.5: Java 17 or higher
  • A database (MariaDB, PostgreSQL, MySQL, H2, etc.)
  • SMTP server for email functionality (optional but recommended)

Step 1: Add Dependencies

  1. Add the main framework dependency (see Installation for version selection):

    Spring Boot 4.0 / 4.1 (Java 21+):

    groovy
    implementation 'com.digitalsanctuary:ds-spring-user-framework:5.3.4'

    Spring Boot 3.5 (Java 17+):

    groovy
    implementation 'com.digitalsanctuary:ds-spring-user-framework:3.6.0'
  2. Add required dependencies:

    Important: This framework requires these additional Spring Boot starters to function properly:

    Maven:

    xml
    
        org.springframework.boot
        spring-boot-starter-thymeleaf
    
    
        org.springframework.boot
        spring-boot-starter-mail
    
    
        org.springframework.boot
        spring-boot-starter-data-jpa
    
    
        org.springframework.boot
        spring-boot-starter-security
    
    
        org.springframework.boot
        spring-boot-starter-oauth2-client
    
    
        org.springframework.retry
        spring-retry
        2.0.13
    

    Gradle:

    groovy
    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
    implementation 'org.springframework.boot:spring-boot-starter-mail'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
    implementation 'org.springframework.retry:spring-retry:2.0.13'

    Notes:

    • spring-boot-starter-oauth2-client is required even if you don't plan to use social login. The framework's security chain wires OAuth2 user services at startup; the dependency must be on the classpath so the classes resolve. The OAuth2 login flow itself is disabled by default and opt-in — set spring.security.oauth2.enabled=true in your application properties only when you configure OAuth2 provider credentials (this is a framework property, not a standard Spring Security key).
    • spring-retry needs an explicit version because Spring Boot's BOM may not manage this artifact. The version shown matches what the framework is built against.

Step 2: Database Configuration

Configure your database in application.yml. The framework supports all databases compatible with Spring Data JPA:

MariaDB/MySQL:

yaml
spring:
  datasource:
    url: jdbc:mariadb://localhost:3306/yourdb?createDatabaseIfNotExist=true
    username:

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javaspringspring-bootspring-securityspringboot

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架