Levge.Identity
1.1.45
See the version list below for details.
dotnet add package Levge.Identity --version 1.1.45
NuGet\Install-Package Levge.Identity -Version 1.1.45
<PackageReference Include="Levge.Identity" Version="1.1.45" />
<PackageVersion Include="Levge.Identity" Version="1.1.45" />
<PackageReference Include="Levge.Identity" />
paket add Levge.Identity --version 1.1.45
#r "nuget: Levge.Identity, 1.1.45"
#:package Levge.Identity@1.1.45
#addin nuget:?package=Levge.Identity&version=1.1.45
#tool nuget:?package=Levge.Identity&version=1.1.45
<img src="src/Levge.Identity/icon.png" width="100" height="100" alt="Levge.Identity logo" />
Levge.Identity
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
- 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); - 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
IJwtTokenServicefor access/refresh token generation. - Password hashing:
Use
IPasswordHasherfor secure password storage. - Code generation:
Use
ICodeGeneratorfor 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 | Versions 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. |
-
net8.0
- Levge.Exceptions (>= 1.1.43)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 8.0.23)
- Microsoft.AspNetCore.Authentication.OpenIdConnect (>= 8.0.23)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Levge.Identity:
| Package | Downloads |
|---|---|
|
Levge.AuditLog
EF Core tabanlı otomatik audit log altyapısı. Tenant ve soft-delete desteğiyle birlikte clean architecture uyumlu denetim kaydı çözümü. |
|
|
Levge.Tenancy
SaaS uygulamaları için çok kiracılı (multi-tenant) altyapı. JWT tabanlı tenant çözümleme, EF Core Global Query Filter ve tenant yaşam döngüsü yönetimi. |
|
|
Levge.MediatR
MediatR tabanlı domain event dispatcher, EF Core interceptor ve FluentValidation pipeline behavior. IDomainEventDispatcher implementasyonu, SaveChanges sonrası otomatik domain event dispatch ve ValidationBehavior altyapısı. |
|
|
Levge.Caching
Levge ekosistemi için opsiyonel önbellekleme altyapısı. Memory Cache ve Redis desteği, JWT token revoke servisi. AddLevgeCaching() ile projeye eklenebilir. |
|
|
Levge.Subscription
Levge ekosistemi için opsiyonel abonelik ve kota takip altyapısı. Plan, modül, tenant aboneliği, kullanım takibi ve yenileme job desteği. AddLevgeSubscription() ile projeye eklenebilir. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.3.0 | 166 | 4/29/2026 |
| 2.1.0 | 121 | 4/27/2026 |
| 2.0.1 | 136 | 4/27/2026 |
| 1.1.46 | 148 | 1/22/2026 |
| 1.1.45 | 291 | 1/20/2026 |
| 1.1.44 | 115 | 1/20/2026 |
| 1.1.43 | 509 | 7/3/2025 |
| 1.1.42 | 237 | 7/3/2025 |
| 1.1.41 | 259 | 6/22/2025 |
| 1.1.21 | 188 | 6/22/2025 |
| 1.1.1 | 495 | 6/18/2025 |
| 1.1.0 | 231 | 6/18/2025 |
| 1.0.5 | 215 | 6/17/2025 |
| 1.0.4 | 222 | 6/17/2025 |
| 1.0.3 | 219 | 6/17/2025 |
| 1.0.2 | 222 | 6/17/2025 |
| 1.0.0 | 238 | 6/16/2025 |