JWTLogout.Net 1.0.8

dotnet add package JWTLogout.Net --version 1.0.8                
NuGet\Install-Package JWTLogout.Net -Version 1.0.8                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JWTLogout.Net" Version="1.0.8" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JWTLogout.Net --version 1.0.8                
#r "nuget: JWTLogout.Net, 1.0.8"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install JWTLogout.Net as a Cake Addin
#addin nuget:?package=JWTLogout.Net&version=1.0.8

// Install JWTLogout.Net as a Cake Tool
#tool nuget:?package=JWTLogout.Net&version=1.0.8                

Dotnet_JWTLogout

JWTLogout Version

Introduction

Never trust anything coming from the client-side they said, but why you are still trusting the client-side to handle your application logout properly and effectively, when all he did, was delete the stored jwt from the browser local storage.
If such stored jwt was copied before it is deleted, or it was intercepted in transit, it can still be used on a different computer or browser, and it will still work perfectly like it was never deleted.

This package aims to help you handle your logout process seamlessly with just 3 lines of code:
~> var jwtCheck = new JwtCheck().Login(generatedJwt); in your login method
~> var jwtCheck = new JwtCheck().Logout(httpContext); in your logout method
~> app.UseJWTCheck(); in your program.cs

N:B ⇒ you can check this link: Dotnet_JWTLogoutAsync for the async method equivalent

Use Case

  • You wish to disable Jwt from authorizing your application before the token expiry time elapse.
  • It can be used with your custom Jwt implementation as well as with ASP.NET Identity.

Support

  • .NET Core 6.0 and newer

Installation

You can clone this repo and reference it in your project.

Install via .NET CLI

dotnet add package JWTLogout.Net --version 1.0.1

Install via Package Manager

Install-Package JWTLogout.Net -Version 1.0.1

Usage

To enable JWTLogout to listen for requests, use the middleware provided by JWTLogout.
Add JWTLogout Namespace in Program.cs

using JWTLogout.Net.Helpers
Call JWTLogout middleware after app.UseAuthorization() in program.cs;
...
app.UseAuthentication();
app.UseAuthorization();
app.UseJWTCheck();
...
Call JwtCheck.Login() method at the bottom of your Login Function/ActionMethod;
...
var jwtCheck = new JwtCheck().Login(generatedJwt);
...
Call JwtCheck.Logout() method at the bottom of your Logout Function/ActionMethod;
...
var jwtCheck = new JwtCheck().Logout(httpContext)
...

Contribution

Feel like something is missing? Fork the repo and send a PR.

Encountered a bug? Fork the repo and send a PR.

Alternatively, open an issue and we'll get to it as soon as we can.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.8 335 6/27/2023
1.0.6 184 6/27/2023
1.0.5 206 6/14/2023
1.0.4 193 6/12/2023
1.0.3 191 6/12/2023
1.0.2 200 6/12/2023
1.0.1 239 4/6/2023