net-jwt-auth

Implement JWT authentication and authorization for ASP.NET Core APIs.

165|62|Updated Jan 9, 2026
One-click install
npx skills add https://github.com/mitkox/ai-coding-factory --skill net-jwt-auth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: net-jwt-auth
Source: https://github.com/mitkox/ai-coding-factory/tree/main/.opencode/skill/net-jwt-auth
Command: npx skills add https://github.com/mitkox/ai-coding-factory --skill net-jwt-auth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a ready-to-use JWT authentication and authorization layer for ASP.NET Core APIs, reducing boilerplate and improving security by standardizing token issuance, validation, and access control.

Core Features & Use Cases

  • Token generation and validation for protected endpoints
  • Refresh token support and claims-based authorization
  • Password hashing and user claims handling for secure identity management
  • Use Case: Secure a public API by issuing JWTs to authenticated users and enforcing role-based access

Quick Start

Run these steps to enable JWT authentication in your ASP.NET Core project:

  • Add Jwt infrastructure (JwtTokenGenerator, JwtTokenValidator, PasswordHasher, etc.) to your project
  • Configure JwtSettings in appsettings.json and register the settings in DI
  • Wire up authentication and authorization in Program.cs and protect endpoints with [Authorize]

Frequently Asked Questions about net-jwt-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement JWT authentication in an ASP.NET Core API?

You implement JWT authentication in ASP.NET Core by adding token generation and validation infrastructure, configuring JwtSettings in appsettings.json, registering services in DI, and wiring up middleware in Program.cs to protect endpoints with the [Authorize] attribute.

What is the best way to secure ASP.NET Core API endpoints with role-based access control?

The best way to secure ASP.NET Core API endpoints with role-based access control is by issuing JWTs with specific claims and enforcing authorization policies via the [Authorize] attribute to restrict endpoint access based on user roles.

Does ASP.NET Core support JWT refresh tokens out of the box?

ASP.NET Core supports JWT validation natively, but implementing refresh tokens requires custom infrastructure to issue new access tokens, which this Skill provides by standardizing token issuance, validation, and claims handling for secure identity management.

How do I handle password hashing and user claims for JWT token generation?

You handle password hashing and user claims for JWT token generation by utilizing a dedicated PasswordHasher component that securely manages credentials and maps user identity data into claims before issuing the authentication token.

Can I use this JWT authorization layer for an existing ASP.NET Core project?

Yes, you can integrate this JWT authorization layer into an existing ASP.NET Core project by adding the required token infrastructure components, updating your DI configuration, and applying the [Authorize] attribute to your current endpoints.