authentication

Configure JWT bearer and cookie authentication for ASP.NET Core applications.

640|145|Updated Feb 20, 2026
One-click install
npx skills add https://github.com/codewithmukesh/dotnet-claude-kit --skill authentication-codewithmukesh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: authentication
Source: https://github.com/codewithmukesh/dotnet-claude-kit/tree/main/skills/authentication
Command: npx skills add https://github.com/codewithmukesh/dotnet-claude-kit --skill authentication-codewithmukesh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides clear, opinionated guidance to implement secure authentication and authorization in ASP.NET Core projects, removing guesswork about JWT, OpenID Connect, cookie auth, and policy design while preventing common mistakes like storing secrets in code or skipping token validation.

Core Features & Use Cases

  • Authentication Patterns: Step-by-step recommendations for JWT bearer tokens, cookie authentication for web apps, and OpenID Connect integration with external identity providers.
  • Authorization Strategies: Policy-based authorization examples, custom requirements and handlers, role and claim management, and endpoint protection patterns for minimal APIs and grouped routes.
  • Security Best Practices: Token generation and validation guidance, secure secret management, anti-patterns to avoid, and a decision guide for choosing the correct approach for REST APIs, Blazor/MVC, multi-tenant systems, and API-to-API scenarios.

Quick Start

Configure JWT bearer authentication with validated issuer, audience, signing key, and lifetime settings, register policy-based authorization and use ASP.NET Identity for user management.

Frequently Asked Questions about authentication

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

FAQPage Schema
How do I configure JWT bearer authentication in ASP.NET Core?

Configure JWT bearer authentication in ASP.NET Core by validating issuer, audience, signing key, and token lifetime settings to secure REST API endpoints and prevent unauthorized access.

What's the best way to implement policy-based authorization in minimal APIs?

Policy-based authorization in ASP.NET Core uses custom requirements and handlers for endpoint protection patterns, securing minimal APIs and grouped routes through role and claim management.

Does this guidance cover OpenID Connect integration with external identity providers?

Yes, it provides step-by-step recommendations for OpenID Connect integration with external identity providers, alongside cookie authentication and Identity-based user management for MVC and Blazor apps.

How do I securely manage authentication secrets in ASP.NET Core applications?

Secure secret management in ASP.NET Core requires storing authentication secrets outside code, applying anti-pattern avoidance and secure storage practices to protect signing keys and token validation configurations.

Can I use ASP.NET Identity for user management alongside JWT authentication?

Yes, ASP.NET Identity integrates with JWT bearer authentication for user management, combining Identity-based user stores with token generation and policy-based authorization for secure endpoint protection.

When should I choose cookie authentication over JWT for my ASP.NET Core web app?

Cookie authentication suits Blazor and MVC web apps, while JWT bearer tokens target REST APIs and API-to-API scenarios, with a decision guide helping choose the correct approach per architecture.