MasLazu.AspNet.Authentication.Core.Base
1.0.0-preview.10
This is a prerelease version of MasLazu.AspNet.Authentication.Core.Base.
dotnet add package MasLazu.AspNet.Authentication.Core.Base --version 1.0.0-preview.10
NuGet\Install-Package MasLazu.AspNet.Authentication.Core.Base -Version 1.0.0-preview.10
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MasLazu.AspNet.Authentication.Core.Base" Version="1.0.0-preview.10" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MasLazu.AspNet.Authentication.Core.Base" Version="1.0.0-preview.10" />
<PackageReference Include="MasLazu.AspNet.Authentication.Core.Base" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MasLazu.AspNet.Authentication.Core.Base --version 1.0.0-preview.10
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MasLazu.AspNet.Authentication.Core.Base, 1.0.0-preview.10"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MasLazu.AspNet.Authentication.Core.Base@1.0.0-preview.10
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MasLazu.AspNet.Authentication.Core.Base&version=1.0.0-preview.10&prerelease
#tool nuget:?package=MasLazu.AspNet.Authentication.Core.Base&version=1.0.0-preview.10&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MasLazu.AspNet.Authentication.Core.Base
This project contains the base implementations for the MasLazu ASP.NET Authentication Core library.
Overview
The MasLazu.AspNet.Authentication.Core.Base project provides:
- Service Implementations: Concrete implementations of authentication and user management interfaces
- JWT Utilities: Token generation, validation, and management utilities
- Validation: FluentValidation validators for request models
- Extensions: Dependency injection and application setup extensions
- Configuration: JWT and authentication configuration classes
- Background Services: Database seeding and maintenance services
Key Services
AuthService: ImplementsIAuthServicefor user authentication and JWT token managementUserService: ImplementsIUserServicefor user CRUD operations and email verificationGenderService,LanguageService,TimezoneService: CRUD services for reference dataLoginMethodService: ImplementsILoginMethodServicefor login method managementUserLoginMethodService: ImplementsIUserLoginMethodServicefor user-login method associations
Key Components
JwtUtil: Utility class for JWT access and refresh token generation and validationJwtConfiguration: Configuration class for JWT settingsAuthenticationCoreApplicationServiceExtension: Extension for registering services in DIAuthenticationCoreDatabaseSeedBackgroundService: Background service for database seeding
Project Configuration
- Target Framework: .NET 9.0
- Implicit Usings: Enabled
- Nullable Reference Types: Enabled
Dependencies
Package References:
MasLazu.AspNet.Framework.Application- Base application frameworkMasLazu.AspNet.Framework.Domain- Domain frameworkMasLazu.AspNet.Verification.Abstraction- Verification abstractionsMicrosoft.Extensions.DependencyInjection- DI containerMicrosoft.Extensions.Hosting- Hosting abstractionsSystem.IdentityModel.Tokens.Jwt- JWT token handlingMicrosoft.IdentityModel.Tokens- Token validation
Project References:
MasLazu.AspNet.Authentication.Core.Domain- Domain entitiesMasLazu.AspNet.Authentication.Core.Abstraction- Service interfaces
Usage
Register the services in your application's DI container:
services.AddAuthenticationCoreApplicationServices();
Configure JWT settings in appsettings.json:
{
"Jwt": {
"Key": "your-secret-key",
"Issuer": "your-issuer",
"Audience": "your-audience",
"AccessTokenExpirationMinutes": 120,
"RefreshTokenExpirationDays": 30
}
}
🛠️ Development Guidelines
Naming Conventions
- Services: Suffix with Service (e.g., AuthService)
- Extensions: Suffix with Extension (e.g., AuthenticationCoreApplicationServiceExtension)
- Validators: Suffix with Validator (e.g., CreateUserRequestValidator)
- Utils: Suffix with Util (e.g., JwtUtil)
- Configuration: Suffix with Configuration (e.g., JwtConfiguration)
Code Structure
src/MasLazu.AspNet.Authentication.Core.Base/
├── BackgroundServices/ # Background services for maintenance
├── Configuration/ # Configuration classes
├── Extensions/ # DI and application extensions
├── Services/ # Service implementations
├── Utils/ # Utility classes and property maps
├── Validators/ # Request validators
├── MasLazu.AspNet.Authentication.Core.Base.csproj
└── README.md
Best Practices
- Implement interfaces from the Abstraction layer
- Use dependency injection for service dependencies
- Include proper error handling and validation
- Follow async/await patterns consistently
- Use meaningful variable names and XML documentation
🤝 Contributing
- New Services: Implement corresponding interfaces from Abstraction
- Configuration: Add new settings to configuration classes
- Validation: Create validators for new request models
- Extensions: Update DI registration for new services
- Testing: Add unit and integration tests for implementations
📄 License
Part of the MasLazu ASP.NET framework ecosystem.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- MasLazu.AspNet.Authentication.Core.Abstraction (>= 1.0.0-preview.10)
- MasLazu.AspNet.Authentication.Core.Domain (>= 1.0.0-preview.10)
- MasLazu.AspNet.Framework.Application (>= 1.0.0-preview.15)
- MasLazu.AspNet.Framework.Domain (>= 1.0.0-preview.15)
- MasLazu.AspNet.Verification.Abstraction (>= 1.0.0-preview.6)
- Microsoft.Extensions.DependencyInjection (>= 9.0.9)
- Microsoft.Extensions.Hosting (>= 9.0.9)
- Microsoft.IdentityModel.Tokens (>= 8.14.0)
- System.IdentityModel.Tokens.Jwt (>= 8.14.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-preview.10 | 141 | 10/8/2025 |
| 1.0.0-preview.9 | 140 | 10/2/2025 |
| 1.0.0-preview.8 | 136 | 10/1/2025 |
| 1.0.0-preview.7 | 134 | 10/1/2025 |
| 1.0.0-preview.5 | 140 | 9/29/2025 |
| 1.0.0-preview.3 | 270 | 9/18/2025 |
See RELEASES.md for release notes.