SmartJWT 1.0.11
See the version list below for details.
dotnet add package SmartJWT --version 1.0.11
NuGet\Install-Package SmartJWT -Version 1.0.11
<PackageReference Include="SmartJWT" Version="1.0.11" />
<PackageVersion Include="SmartJWT" Version="1.0.11" />
<PackageReference Include="SmartJWT" />
paket add SmartJWT --version 1.0.11
#r "nuget: SmartJWT, 1.0.11"
#:package SmartJWT@1.0.11
#addin nuget:?package=SmartJWT&version=1.0.11
#tool nuget:?package=SmartJWT&version=1.0.11
π§ SmartJWT SDK
Dynamic, Context-Aware JWT Authorization & Rules Engine for .NET
Stop hardcoding permissions.
Build intelligent, adaptive JWT authorization that evolves with your business rules β not your code.
SmartJWT enables you to generate smart JWT tokens whose claims and permissions are dynamically evaluated at runtime based on real-world context such as time, location, operation, resource, role, client identity, and custom business rules.
β¨ Less code. Fewer bugs. Stronger security.
Designed for startups, SaaS platforms, and enterprise-scale systems.
π Why SmartJWT?
Traditional JWTs are static.
Real-world authorization is not.
SmartJWT bridges that gap by introducing a dynamic rules engine that enriches tokens at issuance time β without databases, complex conditionals, or permission sprawl.
With SmartJWT you can:
- β Eliminate hardcoded role/permission logic
- β Adapt authorization based on context
- β Reduce development time and security errors
- β Scale authorization rules without refactoring
- β Monetize and license your platform securely
π How it works
- Get your credentials: Obtain an API Key and an RSA Public Key from the provider.
- Configure SmartJWT: Add the configuration to your
Program.cs. - Define Rules: Create dynamic rules based on roles, time, location, and more.
- Validate & Generate: The SDK validates your API Key using RSA and generates a JWT with dynamic claims and permissions based on your rules. No database connection needed for validation.
π¦ Installation
dotnet add package SmartJWT
// 1. Define your rules
var rules = new List<DynamicRule>
{
new DynamicRule { RuleId = "admin-rule", ... }
};
// 2. Register them in the DI container
builder.Services.AddSingleton<IEnumerable<DynamicRule>>(rules);
// 3. SmartJWT will automatically pick them up via constructor injection
builder.Services.AddDynamicJwt(options => { ... });
Manual Registration (Real-time)
If you prefer to load rules from a dedicated class or at runtime:
public static class SmartRulesJWT
{
public static DynamicRule[] GetMyRules() => new[] {
new DynamicRule { RuleId = "custom-rule-1", ... },
new DynamicRule { RuleId = "custom-rule-2", ... }
};
}
// In your Handler or Controller:
var myRules = SmartRulesJWT.GetMyRules();
_generator.RegisterRules(myRules);
β‘ Quick Start (Program.cs)
Simplify your configuration with a single call:
// Configure SmartJWT (Session Token + Licensing)
builder.Services.AddDynamicJwt(options =>
{
// 1. Session Token Settings
options.SecretKey = "your-custom-32-char-secret-for-your-users";
options.Issuer = "SmartJWT.Example";
options.Audience = "SmartJWT.Users";
options.ExpirationMinutes = 60;
// 2. Licensing & API Key Settings
options.ApiKey = "sk_v1_your_purchased_api_key";
});
π Generating Tokens
Inject DynamicJwtTokenGenerator into your controller , service or handlers and call GenerateSmartJWT passing the request context.
If you configured an ApiKey, you can use GenerateSmartJWT which internally validates the key before proceeding.
Usage Example:
[HttpPost("login")]
public IActionResult Login([FromServices] DynamicJwtTokenGenerator generator)
{
// 1. Create the Request Context
var context = new RequestContext
{
UserId = "user-123",
UserName = "John Doe",
Role = "Admin",
Location = "LATAM",
RequestTime = DateTime.UtcNow,
IsMfaEnabled = true
};
// 2. Add custom data if needed for rules
context.CustomData.Add("Subscription", "Premium");
// 3. Generate the token (Rules are applied automatically)
var response = generator.GenerateSmartJWT(context);
return Ok(new {
token = response.Token,
appliedRules = response.AppliedRuleIds,
permissions = response.Permissions
});
}
π§ Rules Engine Overview
SmartJWT includes a built-in engine to evaluate conditions and dynamically enrich the JWT.
Engine Structure
- DynamicRule: Defines a rule with a
RuleId,Priority,Conditions,ClaimsToAdd, andPermissions. - RuleCondition: A specific requirement (e.g.,
Role Equals Admin) that must be met. - RequestContext: The data provided at runtime (User, Location, Time, etc.) against which rules are evaluated.
Available Condition Types
β
Role (Admin, User, etc.)
β
Location (US, LATAM, EU, etc.)
β
Time (Office hours, specific ranges)
β
Date (Specific calendar dates)
β
Operation (Read, Write, Delete)
β
Resource (Orders, Users, Settings)
β
Area (IT, Finance, HR)
β
Priority (Low, Medium, High)
β
IsMfaEnabled (Boolean status)
β
Enabled (Dynamic boolean status)
β
CustomData (Any custom key-value pair)
Available Operators
β
Equals, NotEquals
β
Contains, NotContains
β
In, NotIn (List of values)
β
GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual (For Sensitivity or Numbers)
β
StartsWith, EndsWith
β
Exists (For CustomData)
π οΈ Developer Definitions
As a developer, you have full control over:
- Rules to create: Defining identifying names like
"admin-office-hours"or"premium-access". - Specific Conditions: Mapping context fields to operators and values.
- Dynamic Claims: What data to inject into the JWT (e.g.,
access_level = "full"). - Permissions: Scopes to grant (e.g.,
"read:all","user:delete"). - Priority: Rules are evaluated in order of priority (higher number = higher priority).
π Practical Use Cases
1. Admin Access During Office Hours
Grant "full" access level only if the user is an Admin and the request is between 08:00 and 18:00.
var rule = new DynamicRule
{
RuleId = "admin-office-hours",
Priority = 10,
Conditions = new List<RuleCondition> {
new RuleCondition { Type = ConditionType.Role, Operator = ConditionOperator.Equals, Value = "Admin" },
new RuleCondition { Type = ConditionType.Time, Operator = ConditionOperator.In, Value = "08:00-18:00" }
},
ClaimsToAdd = new List<DynamicClaim> { new DynamicClaim("access_level", "full") }
};
2. Regional Access Restrictions (LATAM)
Users in LATAM receive "limited" access and only "read" permissions.
var rule = new DynamicRule {
RuleId = "latam-limited-access",
Conditions = new List<RuleCondition> {
new RuleCondition { Type = ConditionType.Location, Operator = ConditionOperator.Equals, Value = "LATAM" }
},
ClaimsToAdd = new List<DynamicClaim> { new DynamicClaim("access_level", "limited") },
Permissions = new List<string> { "read" }
};
3. MFA Required for Priority Resources
Only grant "delete" permissions if the resource priority is "High" AND MFA is enabled.
var rule = new DynamicRule {
RuleId = "secure-delete",
Conditions = new List<RuleCondition> {
new RuleCondition { Type = ConditionType.Priority, Operator = ConditionOperator.Equals, Value = "High" },
new RuleCondition { Type = ConditionType.IsMfaEnabled, Operator = ConditionOperator.Equals, Value = "true" }
},
Permissions = new List<string> { "delete" }
};
4. HR Area Resource Management
Grant managers in the HR Area permission to manage employees.
var rule = new DynamicRule {
RuleId = "hr-manager-rule",
Conditions = new List<RuleCondition> {
new RuleCondition { Type = ConditionType.Area, Operator = ConditionOperator.Equals, Value = "HR" },
new RuleCondition { Type = ConditionType.Role, Operator = ConditionOperator.Equals, Value = "Manager" }
},
Permissions = new List<string> { "manage_employees" }
};
5. Custom Subscription-Based Access
Use CustomData to check for a "Premium" subscription status.
var rule = new DynamicRule {
RuleId = "premium-features",
Conditions = new List<RuleCondition> {
new RuleCondition { Type = ConditionType.CustomData, CustomKey = "Subscription", Operator = ConditionOperator.Equals, Value = "Premium" }
},
ClaimsToAdd = new List<DynamicClaim> { new DynamicClaim("feature_set", "ultimate") }
};
π³ Pricing & Licensing
SmartJWT SDK is licensed per API Key, available on a monthly or yearly basis:
| Plan | Price (USD) |
|---|---|
| Monthly | 50 |
| Yearly | 500 |
To obtain your API Key, please send an email with the subject line:
βRequest for SmartJWT API Keyβ
π§ zefyr92@gmail.com
Once your payment is confirmed, you will receive your API Key and instructions to integrate SmartJWT into your project.
Β© 2026 SmartJWT - Secure & Dynamic Authentication.
| 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
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.IdentityModel.Tokens (>= 7.1.2)
- System.IdentityModel.Tokens.Jwt (>= 7.1.2)
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.0.24 | 98 | 2/17/2026 | |
| 1.0.23 | 101 | 2/10/2026 | |
| 1.0.22 | 100 | 2/10/2026 | |
| 1.0.21 | 97 | 2/10/2026 | |
| 1.0.20 | 97 | 2/10/2026 | |
| 1.0.19 | 110 | 1/31/2026 | |
| 1.0.18 | 103 | 1/31/2026 | |
| 1.0.17 | 111 | 1/31/2026 | |
| 1.0.16 | 110 | 1/16/2026 | |
| 1.0.15 | 107 | 1/16/2026 | |
| 1.0.14 | 103 | 1/16/2026 | |
| 1.0.13 | 107 | 1/16/2026 | |
| 1.0.12 | 103 | 1/16/2026 | |
| 1.0.11 | 101 | 1/16/2026 | |
| 1.0.10 | 144 | 1/14/2026 | |
| 1.0.9 | 143 | 1/14/2026 |