MasLazu.AspNet.Authentication.Core.Endpoint 1.0.0-preview.10

This is a prerelease version of MasLazu.AspNet.Authentication.Core.Endpoint.
dotnet add package MasLazu.AspNet.Authentication.Core.Endpoint --version 1.0.0-preview.10
                    
NuGet\Install-Package MasLazu.AspNet.Authentication.Core.Endpoint -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.Endpoint" 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.Endpoint" Version="1.0.0-preview.10" />
                    
Directory.Packages.props
<PackageReference Include="MasLazu.AspNet.Authentication.Core.Endpoint" />
                    
Project file
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.Endpoint --version 1.0.0-preview.10
                    
#r "nuget: MasLazu.AspNet.Authentication.Core.Endpoint, 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.Endpoint@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.Endpoint&version=1.0.0-preview.10&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=MasLazu.AspNet.Authentication.Core.Endpoint&version=1.0.0-preview.10&prerelease
                    
Install as a Cake Tool

MasLazu.AspNet.Authentication.Core.Endpoint

This project contains the API endpoints for the MasLazu ASP.NET Authentication Core library.

Overview

The MasLazu.AspNet.Authentication.Core.Endpoint project provides:

  • REST API Endpoints: FastEndpoints implementations for authentication and user management
  • Endpoint Groups: Organized API versioning and Swagger documentation
  • CRUD Operations: Complete Create, Read, Update, Delete endpoints for all entities
  • Authentication Endpoints: Login, verification, and user management APIs

API Endpoints

Users Endpoints

  • POST /users - Create user
  • GET /users/{id} - Get user by ID
  • GET /users - Get users paginated
  • PUT /users/{id} - Update user
  • DELETE /users/{id} - Delete user
  • POST /users/send-email-verification - Send email verification

Login Methods Endpoints

  • GET /login-methods/{id} - Get login method by ID
  • GET /login-methods - Get login methods paginated
  • GET /login-methods/enabled - Get all enabled login methods (anonymous)

User Login Methods Endpoints

  • GET /user-login-methods - Get user login methods paginated
  • GET /user-login-methods/{id} - Get by ID
  • POST /user-login-methods - Create
  • PUT /user-login-methods/{id} - Update
  • DELETE /user-login-methods/{id} - Delete

Reference Data Endpoints

  • Genders: CRUD operations for gender data
  • Languages: CRUD operations for language data
  • Timezones: CRUD operations for timezone data

Endpoint Groups

  • UsersEndpointGroup: /api/v1/users/*
  • LoginMethodsEndpointGroup: /api/v1/login-methods/*
  • UserLoginMethodsEndpointGroup: /api/v1/user-login-methods/*
  • GendersEndpointGroup: /api/v1/genders/*
  • LanguagesEndpointGroup: /api/v1/languages/*
  • TimezonesEndpointGroup: /api/v1/timezones/*

Project Configuration

  • Target Framework: .NET 9.0
  • Implicit Usings: Enabled
  • Nullable Reference Types: Enabled

Dependencies

  • Package References:

    • MasLazu.AspNet.Framework.Endpoint - Base endpoint framework
  • Project References:

    • MasLazu.AspNet.Authentication.Core.Abstraction - Service interfaces and models

Usage

Register the endpoints in your application's startup:

app.UseFastEndpoints();

The endpoints will be automatically discovered and registered with FastEndpoints.

Authentication & Authorization

  • Most endpoints require authentication
  • GetAllEnabledLoginMethodsEndpoint allows anonymous access
  • JWT tokens are used for authentication
  • Role-based authorization can be implemented as needed

Response Format

All endpoints return standardized responses:

{
  "data": { ... },
  "message": "Operation completed successfully",
  "success": true
}

Error Handling

  • Validation errors return 400 Bad Request
  • Not found errors return 404 Not Found
  • Unauthorized access returns 401 Unauthorized
  • Forbidden access returns 403 Forbidden
  • Server errors return 500 Internal Server Error

🛠️ Development Guidelines

Naming Conventions

  • Endpoints: Suffix with Endpoint (e.g., CreateUserEndpoint)
  • Endpoint Groups: Suffix with EndpointGroup (e.g., UsersEndpointGroup)
  • Extensions: Suffix with Extension (e.g., AuthenticationCoreEndpointExtension)
  • HTTP Methods: Use appropriate verbs (GET, POST, PUT, DELETE)

Code Structure

src/MasLazu.AspNet.Authentication.Core.Endpoint/
├── Endpoints/             # API endpoint implementations
│   ├── Users/            # User-related endpoints
│   ├── LoginMethods/     # Login method endpoints
│   ├── Genders/          # Gender endpoints
│   └── ...
├── EndpointGroups/       # API grouping and versioning
├── Extensions/           # DI registration extensions
├── MasLazu.AspNet.Authentication.Core.Endpoint.csproj
└── README.md

Best Practices

  • Extend BaseEndpoint<TRequest, TResponse> for standard endpoints
  • Use BaseEndpointWithoutRequest<TResponse> for GET endpoints
  • Implement proper validation using FluentValidation
  • Include XML documentation for Swagger generation
  • Follow RESTful API design principles
  • Use appropriate HTTP status codes

🤝 Contributing

  • New Endpoints: Follow existing patterns and naming conventions
  • Endpoint Groups: Create groups for new resource types
  • Validation: Add request validation using validators
  • Documentation: Include XML comments for Swagger docs
  • Testing: Add integration tests for new endpoints
  • Security: Implement proper authentication and authorization

📄 License

Part of the MasLazu ASP.NET framework ecosystem.

Product 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.

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 148 10/8/2025
1.0.0-preview.9 145 10/2/2025
1.0.0-preview.8 141 10/1/2025
1.0.0-preview.7 139 10/1/2025
1.0.0-preview.5 147 9/29/2025
1.0.0-preview.3 270 9/18/2025

See RELEASES.md for release notes.