BlitzkriegSoftware.Library.JWT
1.2.0
A little helper library to make and validate JWT in C#
Install-Package BlitzkriegSoftware.Library.JWT -Version 1.2.0
dotnet add package BlitzkriegSoftware.Library.JWT --version 1.2.0
<PackageReference Include="BlitzkriegSoftware.Library.JWT" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BlitzkriegSoftware.Library.JWT --version 1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: BlitzkriegSoftware.Library.JWT, 1.2.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install BlitzkriegSoftware.Library.JWT as a Cake Addin
#addin nuget:?package=BlitzkriegSoftware.Library.JWT&version=1.2.0
// Install BlitzkriegSoftware.Library.JWT as a Cake Tool
#tool nuget:?package=BlitzkriegSoftware.Library.JWT&version=1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
JwtDotNetCoreDemo
A small demo of creating and consuming JWT tokens in C#
Some helper methods added.
Example
// Create
var identity = new JwtIdentity("user2");
var secret = JwtHelper.MakeRandomSecret(256);
var helper = new JwtHelper(secret);
var rC = new Models.JwtCreateRequest()
{
Identity = identity,
Audiance = TestAudiance,
Issuer = TestIssuer,
Expires = new System.TimeSpan(0, 15, 0)
};
var jwt = helper.Create(rC);
// Validate
var result = helper.Validate(new Models.JwtValidationRequest()
{
Audiance = TestAudiance,
Issuer = TestIssuer,
Token = jwt
});
About
Stuart Williams
JwtDotNetCoreDemo
A small demo of creating and consuming JWT tokens in C#
Some helper methods added.
Example
// Create
var identity = new JwtIdentity("user2");
var secret = JwtHelper.MakeRandomSecret(256);
var helper = new JwtHelper(secret);
var rC = new Models.JwtCreateRequest()
{
Identity = identity,
Audiance = TestAudiance,
Issuer = TestIssuer,
Expires = new System.TimeSpan(0, 15, 0)
};
var jwt = helper.Create(rC);
// Validate
var result = helper.Validate(new Models.JwtValidationRequest()
{
Audiance = TestAudiance,
Issuer = TestIssuer,
Token = jwt
});
About
Stuart Williams
Release Notes
This is a working version with lots of tests
Dependencies
-
.NETStandard 2.0
- Microsoft.CodeAnalysis.CSharp (>= 3.6.0)
- System.IdentityModel.Tokens.Jwt (>= 6.7.1)
Used By
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.