aspnet-security

Implement JWT authentication, authorization, CORS, and security patterns for ASP.NET Core APIs.

1|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/roberflo/claude-csharp --skill aspnet-security
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aspnet-security
Source: https://github.com/roberflo/claude-csharp/tree/main/skills/aspnet-security
Command: npx skills add https://github.com/roberflo/claude-csharp --skill aspnet-security

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Addresses the complexity of securing ASP.NET Core APIs by providing JWT authentication, authorization, CORS, secrets management, and vulnerability mitigation patterns.

Core Features & Use Cases

  • JWT authentication with token validation and refresh token guidance
  • Policy-based authorization and custom authorization handlers
  • CORS configuration for development and production environments
  • Secrets management, environment variables, and secure configuration
  • Input validation, basic sanitization, and security headers
  • Security checklist and best practices for ASP.NET Core

Quick Start

Follow the guide to apply JWT authentication, authorization policies, CORS settings, and security best practices to your ASP.NET Core APIs.

Frequently Asked Questions about aspnet-security

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

FAQPage Schema
How do I set up JWT authentication and refresh tokens in an ASP.NET Core API?

Set up JWT authentication in ASP.NET Core by configuring token validation parameters and applying refresh token guidance. This secures REST APIs and microservices by managing user identity and token lifecycle across .NET 6+ projects.

What is the best way to configure policy-based authorization with custom handlers in ASP.NET Core?

Policy-based authorization in ASP.NET Core uses custom authorization handlers to enforce granular access control rules. Defining policies and implementing custom handlers restricts user permissions based on specific requirements within REST APIs.

How do I configure CORS policies for development and production environments in ASP.NET Core?

Configure CORS in ASP.NET Core by defining separate policies for development and production environments. Setting specific allowed origins, headers, and methods prevents unauthorized cross-origin requests while enabling legitimate API access.

Does this ASP.NET security guidance cover secrets management and environment variables?

Yes, the ASP.NET security guidance covers secrets management, environment variables, and secure configuration. This ensures sensitive data like API keys and connection strings are protected without hardcoding them in your application.

Can I use these ASP.NET Core security patterns for rate limiting and adding security headers?

Yes, you can use these ASP.NET Core security patterns to implement rate limiting and add security headers. Applying these patterns mitigates vulnerabilities and protects REST APIs from abusive traffic and client-side attacks.

What security checklist and best practices are recommended for securing ASP.NET Core apps?

The ASP.NET Core security checklist recommends input validation, basic sanitization, and applying security headers. Following these best practices systematically mitigates common threats and ensures robust API vulnerability protection.