A comprehensive user and role management system built with Blazor Server and ASP.NET Core Identity, demonstrating advanced authentication and authorization features.
This application provides a complete administrative interface for managing users and roles in an ASP.NET Core application. It features a clean, responsive UI built with Blazor Server components and Bootstrap styling.
- Create Users: Add new users with email, first name, and last name
- Edit Users: Update user information including extended profile fields (NickName, TaxID_RUC)
- Delete Users: Remove users from the system
- Password Generation: Generate secure random passwords for users
- User Search & Pagination: Sortable table with pagination support
- Create Roles: Add new roles to the system
- Edit Roles: Modify existing role names
- Delete Roles: Remove roles (with proper validation)
- Role Assignment: Assign/remove roles from users
- ASP.NET Core Identity: Complete identity management system
- Role-based Authorization: Admin-only access to management features
- Secure Password Handling: Hashed passwords with secure generation
- Profile Management: Users can manage their own profiles
- Responsive Design: Bootstrap-based responsive layout
- Modal Dialogs: Clean popup interfaces for user interactions
- Data Tables: Sortable, paginated tables using BlazorTable component
- Real-time Updates: Server-side Blazor for immediate UI updates
- .NET 5: Target framework
- Blazor Server: UI framework for interactive web applications
- ASP.NET Core Identity: Authentication and authorization
- Entity Framework Core: Data access with SQL Server
- Bootstrap: CSS framework for responsive design
- BlazorTable: Component library for data tables
BlazorRolesMgmt/
??? Areas/Identity/ # ASP.NET Core Identity scaffolded pages
??? Data/ # Entity Framework models and context
??? Helpers/ # Utility classes (password, string helpers)
??? Pages/ # Blazor pages and components
? ??? Components/ # Reusable Blazor components
? ??? ManageUsers.razor # User management interface
? ??? ManageRoles.razor # Role management interface
??? Services/ # Business logic services
??? wwwroot/ # Static files and assets
- .NET 5 SDK
- SQL Server (LocalDB supported)
- Visual Studio 2019/2022 or VS Code
- Clone the repository
- Update the connection string in
appsettings.json
- Run Entity Framework migrations:
dotnet ef database update
- Build and run the application:
dotnet run
The application automatically creates default roles (Admin, Client) on startup. Register a new account and manually assign the Admin role in the database to access management features.
- IManageUsersService: User CRUD operations and role assignment
- IManageRolesService: Role management operations
- PasswordHelper: Secure password generation with complexity requirements
- StringHelper: Utility methods for string operations
- Hasher: Password hashing utilities
- EditUserModal: User creation/editing interface
- EditUserRolesModal: Role assignment interface
- PasswordModal: Password display for new users
- EditRoleModal: Role management interface
The application extends ASP.NET Core Identity with:
- ApplicationUser: Extended user model with FirstName, LastName, NickName, TaxID_RUC
- Standard Identity Tables: Users, Roles, UserRoles, etc.
- Role-based Authorization:
[Authorize(Roles = "Admin")]
protection - Secure Password Generation: 12-character passwords with complexity requirements
- Input Validation: Server-side validation for all forms
- CSRF Protection: Built-in ASP.NET Core protection
This project was built as a learning exercise and portfolio demonstration. It showcases:
- Clean architecture patterns
- Separation of concerns with service layers
- Modern Blazor development practices
- Comprehensive user management features
Last updated: Based on commit from 2021 (project built with .NET 5)
Note: This project is not open for public contributions. It serves as a portfolio piece demonstrating technical capabilities in ASP.NET Core and Blazor development