CodedByKay.BondBridge.JwtAuth 1.0.5-alpha

This is a prerelease version of CodedByKay.BondBridge.JwtAuth.
dotnet add package CodedByKay.BondBridge.JwtAuth --version 1.0.5-alpha
NuGet\Install-Package CodedByKay.BondBridge.JwtAuth -Version 1.0.5-alpha
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="CodedByKay.BondBridge.JwtAuth" Version="1.0.5-alpha" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CodedByKay.BondBridge.JwtAuth --version 1.0.5-alpha
#r "nuget: CodedByKay.BondBridge.JwtAuth, 1.0.5-alpha"
#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 CodedByKay.BondBridge.JwtAuth as a Cake Addin
#addin nuget:?package=CodedByKay.BondBridge.JwtAuth&version=1.0.5-alpha&prerelease

// Install CodedByKay.BondBridge.JwtAuth as a Cake Tool
#tool nuget:?package=CodedByKay.BondBridge.JwtAuth&version=1.0.5-alpha&prerelease

JwtAuthExtension Class Library

Overview

The JwtAuthExtension class library provides a straightforward and efficient way to integrate JWT (JSON Web Token) authentication into ASP.NET Core applications. It simplifies the process of configuring authentication and authorization mechanisms, focusing on token validation, issuer, and audience verification.

Features

  • Easy integration with ASP.NET Core services.
  • Configures JWT authentication with minimal setup.
  • Supports token validation parameters including issuer signing key, issuer, audience, and token lifetime.
  • Facilitates authorization policy definitions for different user roles.

Getting Started

Prerequisites

  • .NET Core SDK (version 3.1 or later)
  • An ASP.NET Core project

Installation

  1. Ensure your project file (.csproj) is properly configured to generate a NuGet package.
  2. Use the dotnet pack command to create a NuGet package from your class library.
  3. Add the generated NuGet package to your ASP.NET Core project.

Usage

To use the JwtAuthExtension in your project, follow these steps:

  1. In your Startup.cs, import the namespace:
   using CodedByKay.BondBridge.JwtAuth.JwtAuthExtension;

Call the AddJwtAuthentication extension method within the ConfigureServices method of your Startup.cs, passing the necessary parameters:

public void ConfigureServices(IServiceCollection services)
{
    services.AddJwtAuthentication(secretKey: "YourSecretKey", issuer: "YourIssuer", audience: "YourAudience");
}

Configuration

Customize your JWT authentication by modifying the parameters passed to AddJwtAuthentication:

  • secretKey: Your secret key for signing tokens.
  • issuer: The issuer of the token.
  • audience: The audience of the token.

Contributing

Contributions to the JwtAuthExtension library are welcome. Please follow the standard fork-and-pull request workflow.

License Specify your license here. Common licenses for open-source projects include MIT, GPL, and Apache 2.0.

Contact For support or to contact the maintainers, please provide contact details or link to the project's issues page.

Pack the library like this

dotnet pack -c Release -o ./nuget

Remember to replace placeholder texts like "YourNamespace", "YourSecretKey", "YourIssuer", and "YourAudience" with the actual values specific to your project. Also, decide on a license that fits your project's needs and include it in the README.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.5-alpha 60 2/24/2024
1.0.4-alpha 48 2/24/2024
1.0.3-alpha 45 2/24/2024
1.0.2-alpha 55 2/24/2024
1.0.1-alpha 57 2/24/2024
1.0.0-alpha 47 2/24/2024