dotnet-api-security

Configure ASP.NET Core API security with Identity, JWT, OAuth/OIDC, CORS, and rate limiting.

Updated Aug 16, 2025
One-click install
npx skills add https://github.com/dodyg/blue-nile-pds --skill dotnet-api-security-dodyg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-api-security
Source: https://github.com/dodyg/blue-nile-pds/tree/main/.agents/skills/dotnet-api-security
Command: npx skills add https://github.com/dodyg/blue-nile-pds --skill dotnet-api-security-dodyg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Secures ASP.NET Core APIs by configuring Identity, OAuth/OIDC, JWT bearer authentication, passkeys, CORS, and rate limiting to prevent unauthorized access and data exposure.

Core Features & Use Cases

  • ASP.NET Core Identity configuration and Identity API endpoints
  • OAuth 2.0 / OpenID Connect integration with external providers
  • JWT bearer token authentication and policy-based authorization
  • Passkey / WebAuthn authentication (.NET 10)
  • CORS policies and Content Security Policy headers
  • Rate limiting middleware (fixed window, sliding window, token bucket, concurrency)

Quick Start

Configure Identity API endpoints, enable JWT bearer authentication, and wire OpenID Connect provider configuration to secure your API.

Frequently Asked Questions about dotnet-api-security

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

FAQPage Schema
How do I secure an ASP.NET Core API with JWT bearer authentication?

You secure ASP.NET Core APIs with JWT bearer authentication by configuring token validation and applying per-endpoint authorization policies. This approach prevents unauthorized access by requiring valid tokens for incoming requests.

What's the best way to add OAuth and external provider login to an ASP.NET Core API?

Integrate OAuth 2.0 and OpenID Connect external providers into your ASP.NET Core API to handle external authentication. This approach delegates user authentication to external providers, returning secure tokens for API access.

Can I use passkeys for passwordless login in ASP.NET Core?

Yes, you can implement passkeys for passwordless login in ASP.NET Core using WebAuthn authentication. This feature is supported on the .NET 10 stack, providing phishing-resistant cryptographic credentials for secure user management.

How do I configure rate limiting middleware in an ASP.NET Core API?

Configure rate limiting middleware in your ASP.NET Core API to control request rates and prevent abuse. You can apply fixed window, sliding window, token bucket, or concurrency limiters to restrict incoming request volumes.

Does this API security configuration support .NET 8 and later versions?

Yes, this API security configuration supports the .NET 8+ stack for ASP.NET Core Identity, JWT bearer authentication, and rate limiting. It also supports passkey WebAuthn authentication introduced in .NET 10.

Why configure CORS and Content Security Policy headers on an ASP.NET Core API?

Configure CORS policies and Content Security Policy headers to prevent unauthorized data exposure during cross-origin calls. CORS restricts which origins can access your API, while CSP headers mitigate injection and data exfiltration attacks.