Asya.JwtManager
1.0.1-rc
dotnet add package Asya.JwtManager --version 1.0.1-rc
NuGet\Install-Package Asya.JwtManager -Version 1.0.1-rc
<PackageReference Include="Asya.JwtManager" Version="1.0.1-rc" />
paket add Asya.JwtManager --version 1.0.1-rc
#r "nuget: Asya.JwtManager, 1.0.1-rc"
// Install Asya.JwtManager as a Cake Addin #addin nuget:?package=Asya.JwtManager&version=1.0.1-rc&prerelease // Install Asya.JwtManager as a Cake Tool #tool nuget:?package=Asya.JwtManager&version=1.0.1-rc&prerelease
Asya JWT Manager
a lightweight JWT authentication manager that's allow you to work with JWT token easily and safe
you can register the package on the startup class as following
in Configure method call
UseAsyaJwtServices(configuration);
and you should pass the configuration instance on this function
then you must adding the JWT settings in you appsettings.json file as following
Property | Description | Default Value |
---|---|---|
Secret | the secret key for you token generator | none |
Issuer | the token issuer | none |
Audience | the token audience | none |
ValidateIssuer | should manager validate issuer | false |
ValidateAudience | should manager validate audience | false |
ValidateLifeTime | the token validation life time in minutes | none |
ValidateIssuerSigningKey | should token validate the issuer signing key | false |
AccessTokenExpiration | the access token expiring life time in minutes | none |
RefreshTokenExpiration | the refresh token expiring life time in minutes | none |
RemoveCachedRefreshTokensEvery | the automation remover background process for expired tokens in minutes | 1 |
ClockSkew | the token manger ClockSkew value | 1 |
then you have a strong interface with a bunch of ready to use functions as following
AuthenticationResult GenerateTokens(string email, Claim[] claims, DateTime now);
AuthenticationResult Refresh(string refreshToken, string accessToken, DateTime now);
void RemoveExpiredRefreshTokens(DateTime now);
void RemoveRefreshTokenByUserName(string userName);
(ClaimsPrincipal, JwtSecurityToken) DecodeJwtToken(string token);
the AuthenticationResult
should return the following
Proeprty | Type |
---|---|
AccessToken | string |
RefreshToken | RefreshToken |
and the RefreshToken
Proeprty | Type |
---|---|
UserName | string |
TokenString | string |
ExpireAt | datetime |
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net5.0
- Asya.DependencyInjection (>= 1.0.0)
- Microsoft.Extensions.Configuration (>= 5.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 5.0.0)
- Microsoft.Extensions.DependencyInjection (>= 5.0.2)
- System.IdentityModel.Tokens.Jwt (>= 6.12.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 |
---|
Initializing of the JWT manager