jwt-authentication

Configure JWT bearer authentication for .NET APIs with access and refresh tokens.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/hiiamsky/multi-agent-dev-team --skill jwt-authentication-hiiamsky
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jwt-authentication
Source: https://github.com/hiiamsky/multi-agent-dev-team/tree/main/.github/skills/dotnet-jwt-authentication
Command: npx skills add https://github.com/hiiamsky/multi-agent-dev-team --skill jwt-authentication-hiiamsky

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Microsoft.AspNetCore.Authentication.JwtBearer, System.IdentityModel.Tokens.Jwt.

What problem does it solve?

Enables secure, stateless authentication for .NET REST APIs using JWT Bearer tokens, simplifying user verification and cross-service authorization.

Core Features & Use Cases

  • Token generation for access and refresh tokens with configurable lifetimes
  • Claims extraction and role/permission mapping for authorization decisions
  • Rotation and validation of tokens with secure cookie handling for refresh tokens, supporting compliant security practices

Quick Start

Configure your ASP.NET Core project to enable JWT authentication by wiring JwtService and JwtBearer in your Program or Startup.

Frequently Asked Questions about jwt-authentication

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?

JWT authentication provides stateless sessions using access and refresh tokens across services, simplifying user verification and cross-service authorization for .NET REST APIs without server-side session storage.

How do I handle refresh token rotation in .NET APIs?

Generate access and refresh tokens with configurable lifetimes, then extract claims and map roles or permissions for authorization decisions across your .NET REST API endpoints using the JwtService.

Do I need Microsoft.AspNetCore.Authentication.JwtBearer to secure my API?

Yes, you need Microsoft.AspNetCore.Authentication.JwtBearer along with System.IdentityModel.Tokens.Jwt to configure JwtBearerOptions and JwtOptions for enabling secure JWT authentication in .NET APIs.

What is the best way to manage stateless sessions using JWT in .NET?

The best way to manage stateless sessions using JWT in .NET is configuring JwtBearer in your Startup or Program to validate tokens and extract claims for role and permission mapping across services.

Why does my ASP.NET Core API need both access and refresh tokens?

Your ASP.NET Core API needs both access and refresh tokens to maintain secure stateless sessions, allowing short-lived access tokens to authorize requests while refresh tokens support rotation and compliant security practices.