AugusteVN.Modules.Auth.Api
1.2.0
dotnet add package AugusteVN.Modules.Auth.Api --version 1.2.0
NuGet\Install-Package AugusteVN.Modules.Auth.Api -Version 1.2.0
<PackageReference Include="AugusteVN.Modules.Auth.Api" Version="1.2.0" />
<PackageVersion Include="AugusteVN.Modules.Auth.Api" Version="1.2.0" />
<PackageReference Include="AugusteVN.Modules.Auth.Api" />
paket add AugusteVN.Modules.Auth.Api --version 1.2.0
#r "nuget: AugusteVN.Modules.Auth.Api, 1.2.0"
#:package AugusteVN.Modules.Auth.Api@1.2.0
#addin nuget:?package=AugusteVN.Modules.Auth.Api&version=1.2.0
#tool nuget:?package=AugusteVN.Modules.Auth.Api&version=1.2.0
AugusteVN.Modules.Auth.Api
Minimal API endpoints for authentication, identity, roles, and user management with custom scoped-permission authorization and EF Core/SQL Server persistence.
Extension Methods
AddAuthApi(this IServiceCollection, IConfiguration)
Registers the full EF Core auth pipeline:
- ASP.NET Core Identity with
UserandRoleentities - FluentValidation validators from the
_Sharedassembly - SMTP configuration (
SmtpConfig) andIdentityConfig(frontend URLs for email links) IEmailSender<TUser>asIdentityEmailSender<TUser>backed bySmtpMailerPermissionAuthorizationHandlerandFlexibleAuthorizationPolicyProviderfor claims-based scoped authorizationEfCoreUserClaimsPrincipalFactorythat emits per-scope permission claims
builder.Services.AddAuthDbContext(builder.Configuration);
builder.Services.AddAuthApi(builder.Configuration);
The API registers EfCoreUserClaimsPrincipalFactory to enrich ClaimsPrincipal with permissions_{Scope} claims and IdentityEmailSender<TUser> for confirmation and password-reset links.
MapAuthEndpoints(this IEndpointRouteBuilder)
Maps all identity, roles, and users endpoint groups with EndpointExceptionFilter:
- Identity endpoints under
/Auth - Roles endpoints under
/Roles - Users endpoints under
/Users
API Routes
Identity
| Method | Route | Authorization | Description |
|---|---|---|---|
| POST | /Auth/register |
Anonymous | Register a new user account |
| POST | /Auth/login |
Anonymous | Authenticate and receive access/refresh tokens |
| POST | /Auth/forgotPassword |
Anonymous | Request a password reset code via email |
| POST | /Auth/resetPassword |
Anonymous | Reset password using the emailed code |
| GET | /Auth/confirmEmail |
Anonymous | Confirm email address with verification code |
| POST | /Auth/resendConfirmationEmail |
Anonymous | Resend email confirmation link |
| POST | /Auth/refresh |
Anonymous | Exchange refresh token for new access token |
| GET | /Auth/user-info |
Authorized | Get current user profile, roles, and scoped permissions |
| POST | /Auth/user-info |
Authorized | Update current user's password (not yet implemented) |
| PUT | /Auth/user-info |
Authorized | Update current user's profile information |
Roles
| Method | Route | Authorization | Description |
|---|---|---|---|
| GET | /Roles/ |
ManageRoles |
Retrieve all roles |
| GET | /Roles/{UserId} |
ManageRoles |
Retrieve roles assigned to a specific user |
| POST | /Roles/ |
ManageRoles |
Create a new role |
| PUT | /Roles/{Id} |
ManageRoles |
Update an existing role |
| DELETE | /Roles/{Id} |
ManageRoles |
Delete a role |
| PUT | /Roles/{Id}/permissions |
ManagePermissions |
Replace permissions for a specific role |
Users
| Method | Route | Authorization | Description |
|---|---|---|---|
| GET | /Users/ |
ManageUsers |
Retrieve a paginated list of users |
| POST | /Users/ |
ManageUsers |
Create a new user (not yet implemented) |
| PUT | /Users/ |
ManageUsers |
Create or update a user (upsert) |
| DELETE | /Users/{Id} |
ManageUsers |
Delete a user |
Authorization
The module uses a custom authorization pipeline instead of standard [Authorize] attributes on handlers:
AuthorizeAttribute— Converts(scope, sum)pairs into policy names viaPolicyNameHelperFlexibleAuthorizationPolicyProvider— Dynamically createsAuthorizationPolicyinstances for scoped permission policies on demandPermissionAuthorizationHandler— EvaluatesPermissionAuthorizationRequirementby checking if the user's per-scope permission claim satisfies the required bitmaskEfCoreUserClaimsPrincipalFactory— Enriches the user'sClaimsPrincipalwithpermissions_{Scope}claims
Swagger Support
Call AddAuthOptions() on SwaggerGenOptions to add Bearer token security definitions:
builder.Services.AddSwaggerGen(options => options.AddAuthOptions());
Installation
dotnet add package AugusteVN.Modules.Auth.Api
Full Documentation
See the Auth Module README for complete documentation.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- AugusteVN.Api.Auth.Extensions (>= 1.1.0)
- AugusteVN.Api.EndpointFilters (>= 1.1.0)
- AugusteVN.CQRS.Extensions (>= 1.1.5)
- AugusteVN.MailKit.SmtpMailer (>= 1.2.0)
- AugusteVN.Modules.Auth._Shared (>= 1.0.9)
- AugusteVN.Modules.Auth.Database (>= 1.1.2)
- AugusteVN.Modules.Auth.Features (>= 1.1.5)
- AugusteVN.ResultPattern.Extensions (>= 1.1.4)
- FluentValidation.DependencyInjectionExtensions (>= 12.1.1)
- MailKit (>= 4.17.0)
- Microsoft.OpenApi (>= 1.6.22)
- Swashbuckle.AspNetCore (>= 6.5.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.2.0 | 97 | 9/17/2026 |
| 1.1.9 | 95 | 9/17/2026 |
| 1.1.8 | 93 | 9/15/2026 |
| 1.1.7 | 83 | 9/15/2026 |
| 1.1.6 | 89 | 9/15/2026 |
| 1.1.5 | 85 | 9/15/2026 |
| 1.1.4 | 87 | 9/15/2026 |
| 1.1.3 | 90 | 9/14/2026 |
| 1.1.2 | 95 | 9/12/2026 |
| 1.1.1 | 92 | 9/12/2026 |
| 1.1.0 | 90 | 9/11/2026 |
| 1.0.9 | 93 | 9/11/2026 |
| 1.0.8 | 121 | 8/19/2026 |
| 1.0.7 | 113 | 8/9/2026 |
| 1.0.4 | 107 | 8/9/2026 |
| 1.0.3 | 104 | 8/9/2026 |
| 1.0.2 | 106 | 8/8/2026 |
| 1.0.1 | 103 | 8/8/2026 |
| 1.0.0 | 103 | 8/8/2026 |