DX.Blazor.Identity 26.1.3.30

dotnet add package DX.Blazor.Identity --version 26.1.3.30
                    
NuGet\Install-Package DX.Blazor.Identity -Version 26.1.3.30
                    
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="DX.Blazor.Identity" Version="26.1.3.30" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DX.Blazor.Identity" Version="26.1.3.30" />
                    
Directory.Packages.props
<PackageReference Include="DX.Blazor.Identity" />
                    
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 DX.Blazor.Identity --version 26.1.3.30
                    
#r "nuget: DX.Blazor.Identity, 26.1.3.30"
                    
#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 DX.Blazor.Identity@26.1.3.30
                    
#: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=DX.Blazor.Identity&version=26.1.3.30
                    
Install as a Cake Addin
#tool nuget:?package=DX.Blazor.Identity&version=26.1.3.30
                    
Install as a Cake Tool

DX.Blazor.Identity

Shared authentication contracts and models used by both DX.Blazor.Identity.Server and DX.Blazor.Identity.Wasm — install this package (it comes in transitively with either of those) to get the IAuthService/ITokenService interfaces and the request/response models your Blazor components bind to. This package alone doesn't implement anything; it's the shared "wire format" both sides agree on.

Target frameworks: net9.0, net10.0 DevExpress dependency: transitive, via DX.Data.Xpo.Identity (26.1.*)

Install

Normally installed transitively via DX.Blazor.Identity.Server or DX.Blazor.Identity.Wasm:

dotnet add package DX.Blazor.Identity.Server   # Blazor Server / hosted WASM API project
dotnet add package DX.Blazor.Identity.Wasm     # Blazor WASM client project

IAuthService (IAuthService.cs)

public interface IAuthService<TRegistrationModel, TAuthenticationModel>
{
    Task<RegistrationResponseModel> RegisterUser(TRegistrationModel userForRegistration);
    Task<AuthResponseModel> Login(TAuthenticationModel userForAuthentication);
    Task Logout();
    Task<string> RefreshToken();
}

public interface IAuthService<TRegistrationModel> : IAuthService<TRegistrationModel, AuthenticationModel> { }
public interface IAuthService : IAuthService<RegistrationModel, AuthenticationModel> { }

This is what your Blazor components (Login.razor, Register.razor, ...) inject and call — AuthenticationService<...> in DX.Blazor.Identity.Server (redirect-based Server flow) and DX.Blazor.Identity.Wasm.Services.AuthenticationService (token/localStorage-based WASM flow) are the two concrete implementations, registered under the same IAuthService interface so your Razor markup doesn't need to know or care which hosting model it's running under.

ITokenService<TKey, TUser> (ITokenService.cs)

public interface ITokenService<TKey, TUser> where TUser : IdentityUser<TKey>, IIdentityRefreshToken
{
    SigningCredentials GetSigningCredentials();
    Task<List<Claim>> GetClaims(TUser user);
    JwtSecurityToken GenerateTokenOptions(SigningCredentials signingCredentials, List<Claim> claims);
    string GenerateRefreshToken();
    ClaimsPrincipal GetPrincipalFromExpiredToken(string token);
}

Implemented by DX.Blazor.Identity.Wasm.Services.TokenService<TKey, TUser> — reads JwtSettings:securityKey/validIssuer/validAudience/expiryInMinutes from IConfiguration to mint and validate JWTs. The IIdentityRefreshToken constraint on TUser (defined in DX.Data) means your ApplicationUser needs RefreshToken/RefreshTokenExpiryTime properties — DX.Data.Xpo.Identity's IXPUser<TKey> already has these, so the default XPO-backed user model works out of the box.

Models (Models/AuthenticationModels.cs)

public class RegistrationModel { string Email; string Password; string ConfirmPassword; string ReturnUrl; } // + DataAnnotations
public class RegistrationResponseModel { bool IsSuccessfulRegistration; IEnumerable<string> Errors; }
public class AuthenticationModel { string Email; string Password; bool RememberMe; string ReturnUrl; }
public class AuthResponseModel { bool IsAuthSuccessful; string ErrorMessage; string Token; string RefreshToken; }
public class RefreshTokenModel { string Token; string RefreshToken; }

These are the DTOs that cross the wire between the WASM client and the server API (Accounts/Registration, Accounts/Login, token/refresh) — see DX.Blazor.Identity.Wasm's AuthenticationService for the client-side HTTP calls and DX.Blazor.Identity.Server's AuthenticationControllerBase/TokenControllerBase for the server-side handlers.

Notes

  • ApplicationState.cs currently only defines InitialApplicationState { AccessToken, RefreshToken } — a commented-out ApplicationState class remains in the file as a placeholder for future use.
  • See the root README for the full Blazor Server and Blazor Hosted WASM setup walkthrough (DI registration, controllers, and a sample Login.razor).

See the root README for the full package list and DevExpress version alignment notes.

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

NuGet packages (2)

Showing the top 2 NuGet packages that depend on DX.Blazor.Identity:

Package Downloads
DX.Blazor.Identity.Server

Identity helper and configuration for Blazor Server based authorization

DX.Blazor.Identity.Wasm

Identity helper and configuration for Blazor WASM token based authorization

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
26.1.3.30 128 8/6/2026
26.1.3.29 143 7/31/2026
26.1.3.28 153 7/14/2026
25.2.3.27 184 4/7/2026
21.2.8.18 638 6/16/2022

v26.1.3.30: Rebuilt against DX.Data.Xpo.Identity 26.1.3.37 to pick up the System.Security.Cryptography.Xml 8.0.4 fix (NU1903) transitively.
v26.1.3.29: Added a README.md with technical documentation, now embedded in the package via PackageReadmeFile.
v26.1.3.28: Rebuilt against DX.Data.Xpo.Identity 26.1.3.35 to pick up DevExpress v26.1.3 transitively.
v23.2.3.24: Upgraded to .NET 8 and DX v23.2
v23.2.3.23: Upgraded to .NET 8 and DX v23.2
v22.1.4.21: Small fix on refresh token
v22.1.4.20: Upgraded several packages
v22.1.4.19: Upgraded several packages incl DevExpress v21.1.4
v21.2.8.18: New package (with Server and WASM packages) to easily implement Identity with XPO on Blazor Server and WASM