Levge.Identity 1.1.43

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

<img src="src/Levge.Identity/icon.png" width="100" height="100" alt="Levge.Identity logo" />

Levge.Identity

NuGet Build

🌐 Read in Turkish languages


Levge.Identity is a .NET 8 library providing identity and authentication services with JWT support, password hashing, code generation, and extensible user context for modern applications. Includes email notification capabilities.

Features

  • ? JWT-based authentication and authorization
  • ? Strong password hashing (PBKDF2)
  • ? User context and claims access via ICurrentUser<T>
  • ? Secure code and password generation utilities
  • ? Extensible identity provider model
  • ? Easy integration with ASP.NET Core DI

Installation

.NET CLI

dotnet add package Levge.Identity

Package Manager

Install-Package Levge.Identity

Setup

  1. Add configuration in Program.cs: builder.Services.AddIdentity<JwtIdentityProvider, string>(builder.Configuration); Or with custom config: var identityConfig = new IdentityConfig { Jwt = new JwtConfig { Issuer = "your-issuer", Audience = "your-audience", Secret = "your-secret-key", // ...other options } }; builder.Services.AddIdentity<JwtIdentityProvider, string>(identityConfig);
  2. Access current user via DI: public class MyController : ControllerBase { private readonly ICurrentUser<string> _currentUser; public MyController(ICurrentUser<string> currentUser) { _currentUser = currentUser; } // ... }

Usage

  • Generate JWT tokens: Use IJwtTokenService for access/refresh token generation.
  • Password hashing: Use IPasswordHasher for secure password storage.
  • Code generation: Use ICodeGenerator for numeric, alphanumeric, or scoped codes.
  • Access user info: Use ICurrentUser<TKey> to get user id, email, role, claims, etc. var token = jwtTokenService.GenerateAccessToken(claims); var passwordHash = passwordHasher.Hash("myPassword"); var code = codeGenerator.GenerateNumericCode(); if (!_currentUser.IsAuthenticated) throw new LevgeException("Not authenticated");

Configuration Options

Option Description
Issuer JWT token issuer
Audience JWT token audience
Authority Authority for validation
Secret Secret key for signing JWT
AccessTokenExpirationMinutes Access token expiration in minutes
RefreshTokenExpirationMinutes Refresh token expiration in minutes
EnableRefreshTokens Enable refresh tokens
ValidateIssuer Validate issuer
ValidateAudience Validate audience
ValidateLifetime Validate token lifetime
ValidateSigningKey Validate signing key
AuthScheme Authentication scheme (default: Bearer)
DefaultScheme Default authentication scheme

License

MIT License. See LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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 (1)

Showing the top 1 NuGet packages that depend on Levge.Identity:

Package Downloads
Levge.AuditLog

Domain entity, interface, and enumeration base types for Levge projects.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.43 189 7/3/2025
1.1.42 137 7/3/2025
1.1.41 134 6/22/2025
1.1.21 97 6/22/2025
1.1.1 282 6/18/2025
1.1.0 143 6/18/2025
1.0.5 137 6/17/2025
1.0.4 138 6/17/2025
1.0.3 138 6/17/2025
1.0.2 136 6/17/2025
1.0.0 147 6/16/2025