All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.0 - 2026-03-27
IJwtTokenServiceinterface withGenerateToken,ValidateToken,ValidateTokenIgnoreExpiry,GenerateRefreshTokenJwtTokenService— implementation with cryptographically secure token generation viaRandomNumberGeneratorJwtAuthOptions— configurableSecretKey,Issuer,Audience,AccessTokenExpiry,RefreshTokenExpiry,Algorithm,ClockSkewTokenRequestrecord withSubject,Claims, and per-tokenExpiresInoverrideTokenResultrecord withAccessToken,RefreshToken,ExpiresAtAddSimpleJwtBearer(Action<JwtAuthOptions>)extension methodInboundClaimTypeMapcleared to preserve original JWT claim names (sub,role, etc.) without WS-Federation mappingClockSkewexposed as configurable option (default: 30 seconds)SecretKeyvalidated at startup viaValidateOnStart— fails fast with a clear error if missingApiKeyAuthHandler— nativeIAuthenticationHandlerimplementation for API Key schemeApiKeyOptions— configurableHeaderName,QueryParamName,ValidKeys,ValidateKeyAsync- Support for both header-based and query string-based API Key extraction
- Custom async validator delegate (
Func<string, Task<bool>>) for database or external lookups AddApiKeyAuthentication(Action<ApiKeyOptions>)extension methodRequireClaimAttribute— declarative claim-based authorization without manual policy registrationDynamicClaimPolicyProvider— builds[RequireClaim]policies dynamically at runtime viaIAuthorizationPolicyProviderCommonPolicies— built-in named policies:AuthenticatedUser,AdminOnly,ApiKeyOrJwtAuthKitAuthorizationOptions— configurableRoleClaimType,AdminRoleValue,JwtScheme,ApiKeyScheme- Multi-scheme policy (
ApiKeyOrJwt) auto-registered when both JWT and API Key modules are active IRefreshTokenStore— abstraction for refresh token persistenceInMemoryRefreshTokenStore— thread-safe default implementation viaConcurrentDictionaryRefreshTokenEntryrecord withSubject,ExpiresAt,IsRevoked,CreatedAt,MetadataIRefreshTokenService/RefreshTokenService—RefreshAsyncwith token rotation,RevokeAsync,RevokeAllAsyncRefreshTokenException— typed exception for invalid, expired or revoked refresh tokensAddRefreshTokens(Action<RefreshTokenStoreOptions>?)extension method with opt-in custom store viaRefreshTokenStoreOptions.CustomStoreAddAuthKit(Action<AuthKitOptions>)— single fluent entry point that orchestrates all modulesAuthKitOptions— master builder withUseJwt,UseApiKey,UseAuthorization,UseRefreshTokens(all opt-in)AuthKitDefaults— centralized constants for scheme names, claim types, header names and policy namesPackageLicenseExpressionadded to.csproj- Unit test suite (
AspNetCoreAuthKit.Tests) — 26 tests covering JWT generation/validation, API Key integration viaTestServer, refresh token store, refresh flow with token rotation, and dynamic claim policy provider - MIT license
- Null checks added to
JwtTokenServiceandRefreshTokenServiceconstructors catchblock inValidateTokenandValidateTokenIgnoreExpirynarrowed toSecurityTokenException— previously swallowed all exceptions including configuration errorsnotBeforeinGenerateTokensimplified to always useDateTime.UtcNow— previous logic could produce already-expired tokens- Unused
usingdirectives removed fromApiKeyOptions.cs