MasterNeverDown.TokenBlackList
1.1.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package MasterNeverDown.TokenBlackList --version 1.1.2
NuGet\Install-Package MasterNeverDown.TokenBlackList -Version 1.1.2
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="MasterNeverDown.TokenBlackList" Version="1.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MasterNeverDown.TokenBlackList --version 1.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MasterNeverDown.TokenBlackList, 1.1.2"
#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 MasterNeverDown.TokenBlackList as a Cake Addin #addin nuget:?package=MasterNeverDown.TokenBlackList&version=1.1.2 // Install MasterNeverDown.TokenBlackList as a Cake Tool #tool nuget:?package=MasterNeverDown.TokenBlackList&version=1.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MasterNeverDown.TokenBlackList
Features
- LoginLimitMiddleware The LoginLimitMiddleware class is a middleware component in an ASP.NET Core application that limits login attempts and locks out users after a certain number of failed attempts.
- TokenBlackListMiddleware The TokenBlackListMiddleware class is responsible for checking if a token is blacklisted and preventing access if it is. It also provides a method to blacklist tokens for a specified duration. This middleware is useful for implementing logout functionality by blacklisting tokens upon logout.
Getting Started
Prerequisites
- .NET 6.0 SDK or later
- Visual Studio or JetBrains Rider
Installation
- Clone the repository:
git clone https://github.com/your-repo/MasterNeverDown.TokenBlackList.git
Build
- Navigate to the project directory:
cd MasterNeverDown.TokenBlackList
- Restore the dependencies:
dotnet restore
Running the Application
Build and run the application:
dotnet run
Open your browser and navigate to https://localhost:5001/swagger to access the Swagger UI.
Usage
- Login Send a POST request to /Account/login with the following JSON body:
//return 403 if login failed more than 3 times
app.UseMiddleware<LoginLimitMiddleware>();
// add token to blacklist if user logout
app.UseMiddleware<TokenBlackListMiddleware>();
License
This project is licensed under the MIT License.
Product | Versions 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. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Microsoft.AspNetCore.Http.Features (>= 5.0.17)
- Microsoft.AspNetCore.Mvc.Abstractions (>= 2.2.0)
- Microsoft.AspNetCore.Mvc.Core (>= 2.2.5)
- Microsoft.Extensions.Caching.Memory (>= 9.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 6.0.0)
- Microsoft.IdentityModel.Tokens (>= 8.2.1)
- System.IdentityModel.Tokens.Jwt (>= 8.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.