MasterNeverDown.TokenBlackList 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package MasterNeverDown.TokenBlackList --version 1.0.2                
NuGet\Install-Package MasterNeverDown.TokenBlackList -Version 1.0.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.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MasterNeverDown.TokenBlackList --version 1.0.2                
#r "nuget: MasterNeverDown.TokenBlackList, 1.0.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.0.2

// Install MasterNeverDown.TokenBlackList as a Cake Tool
#tool nuget:?package=MasterNeverDown.TokenBlackList&version=1.0.2                

MasterNeverDown.TokenBlackList

TokenBlackList for logout

Overview

This project demonstrates how to implement JWT authentication with token blacklisting for logout functionality in an ASP.NET Core application.

Features

  • JWT authentication
  • Token blacklisting for logout
  • Swagger integration for API documentation

Getting Started

Prerequisites

  • .NET 6.0 SDK or later
  • Visual Studio or JetBrains Rider

Installation

  1. Clone the repository:
    git clone https://github.com/your-repo/MasterNeverDown.TokenBlackList.git
    
    
    

Build

  1. Navigate to the project directory:
cd MasterNeverDown.TokenBlackList
  1. Restore the dependencies:
dotnet restore

Configuration

Update the appsettings.json file with your JWT settings:

{
    "Jwt": {
        "Key": "your_secret_key",
        "Issuer": "your_issuer",
        "Audience": "your_audience"
    }
}

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:
{
  "username": "test",
  "password": "password"
}
  • Logout Send a POST request to /Account/logout with the JWT token in the Authorization header:
Authorization: Bearer {token}

License

This project is licensed under the MIT License.

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.  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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.