AugusteVN.Modules.Auth._Shared.Spa
1.0.7
dotnet add package AugusteVN.Modules.Auth._Shared.Spa --version 1.0.7
NuGet\Install-Package AugusteVN.Modules.Auth._Shared.Spa -Version 1.0.7
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="AugusteVN.Modules.Auth._Shared.Spa" Version="1.0.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AugusteVN.Modules.Auth._Shared.Spa" Version="1.0.7" />
<PackageReference Include="AugusteVN.Modules.Auth._Shared.Spa" />
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 AugusteVN.Modules.Auth._Shared.Spa --version 1.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AugusteVN.Modules.Auth._Shared.Spa, 1.0.7"
#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 AugusteVN.Modules.Auth._Shared.Spa@1.0.7
#: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=AugusteVN.Modules.Auth._Shared.Spa&version=1.0.7
#tool nuget:?package=AugusteVN.Modules.Auth._Shared.Spa&version=1.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
AugusteVN.Modules.Auth._Shared.Spa
Blazor components and services for authentication flows, user profile management, and admin panels — ready to embed in any Blazor SPA.
Blazor Components
Layout & State
| Component | Description |
|---|---|
AuthStateLayout |
Observes AuthState.PropertyChanged and fires OnAuthStateChanged with the current AuthStateContext. Use as a root wrapper to react to login/logout. |
AuthorizedLayout |
Conditional renderer that shows Authorized, IsAuthorizing, or NotAuthorized fragments based on scope+permission or role checks against the current user. |
LogOutLayout |
Renders a "Log out" button that calls AuthState.LogOut(). |
TokenExpiryWatcher |
Background timer (2-minute interval) that checks token expiry and automatically triggers RefreshTokensAsync when tokens are about to expire. |
Identity Flows
| Component | Description |
|---|---|
LoginForm |
Email/password login form with FluentValidation, password visibility toggle, and redirect on success. |
RegisterUserForm |
Registration form with email/password fields, optional ToS checkbox, and FluentValidation. |
ForgotPasswordForm |
Sends a password recovery request by email. |
ResetPasswordForm |
Sets a new password using email + reset code (received from URL parameters). |
ConfirmEmailForm |
Auto-confirms email on mount using UserId and Code parameters. |
ResendConfirmationEmailForm |
Resends the confirmation email by address. |
UpdatePasswordForm |
Changes the current user's password (old + new). |
UpdateUserInfoForm |
Updates the current user's phone number and displays their email. |
User Profile
| Component | Description |
|---|---|
UserInfoLayout |
Displays the current user's ID, email, permissions, and roles. Shows "Not authenticated" when logged out. |
Admin — Users
| Component | Description |
|---|---|
GetUsers |
Fetches and displays a paginated user list with a SearchTerm parameter. Exposes users via ChildContent render fragment. |
LoadMoreUsersBtn |
Loads the next page of users and appends them to AdminState.Users. |
DeleteUserBtn |
Deletes a user by ID. Disables itself when the target is the current user. |
UpsertUserForm |
Full create/edit user form with fields for name, phone, email, password, email-confirmed toggle, password-reset toggle, and role assignment (radio group). |
Admin — Roles & Permissions
| Component | Description |
|---|---|
GetRoles |
Fetches all roles and exposes them via a ChildContent render fragment. |
CreateRoleForm |
Form to create a new role by name. |
DeleteRoleBtn |
Deletes a role by ID with a trash-icon button. |
UpdateRolePermissionsTable |
Interactive checkbox table for managing per-scope permission bitmasks across all roles. Requires ManagePermissions authorization. |
Services
AuthState— Scoped service holdingCurrentUser(UserInfoResponse),AuthTokens(LoginResponse),IsLoggedIn, andShouldRefreshTokens. Manages local storage persistence for tokens and providesIsUserAuthorized(scope, sum)for client-side permission checks.AuthHttpClient— Scoped HTTP client handlingInitAuthStateAsync,LogInAsync,RegisterUserAsync,RefreshTokensAsync,RecoverPasswordAsync,ResetPasswordAsync,ConfirmEmailAsync,ResendConfirmationEmailAsync,GetUserInfoAsync,UpdatePasswordAsync,UpdateUserInfoAsync. Automatically manages Bearer token headers and refresh flow.AdminState— Scoped state holdingRoles(list ofRoleResponse),Users(list ofUserResponse), andUsersPaginationMetadata.AdminHttpClient— Scoped HTTP client for admin operations:InitRolesAsync,GetRolesAsync,GetRolesForUserAsync,CreateRoleAsync,DeleteRoleAsync,UpdateRolePermissionsAsync,InitUsersAsync,InitMoreUsersAsync,GetPaginatedUsersAsync,UpsertUserAsync,DeleteUserAsync.
Extension Method
AddAuthSharedSpa(this IServiceCollection, IConfiguration, PermissionsBuilder) — Registers the PermissionsBuilder singleton (auto-adds the Auth module's permissions), AuthState, AuthHttpClient, AdminState, and AdminHttpClient as scoped services.
Registration
var permissionsBuilder = new PermissionsBuilder();
builder.Services.AddAuthSharedSpa(builder.Configuration, permissionsBuilder);
Installation
dotnet add package AugusteVN.Modules.Auth._Shared.Spa
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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- AugusteVN._Shared.Extensions (>= 1.1.1)
- AugusteVN.Modules.Auth._Shared (>= 1.0.7)
- AugusteVN.Razor.State (>= 1.2.0)
- Blazored.FluentValidation (>= 2.2.0)
- Blazored.LocalStorage (>= 4.5.0)
- Mapster (>= 10.0.10)
- Microsoft.AspNetCore.Components.Web (>= 10.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.