authentication

Implements JWT bearer authentication and authorization policies for ASP.NET Core APIs.

224|87|Updated Dec 15, 2018
One-click install
npx skills add https://github.com/Resgrid/Core --skill authentication-resgrid
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: authentication
Source: https://github.com/Resgrid/Core/tree/main/.opencode/skills/authentication
Command: npx skills add https://github.com/Resgrid/Core --skill authentication-resgrid

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Authentication and authorization guidance that helps you protect ASP.NET Core endpoints correctly, so only the right users (and claims) can access the right resources without leaking secrets or weakening token validation.

Core Features & Use Cases

  • JWT bearer token authentication: Validate issuer, audience, lifetime, and signing keys for API access.
  • Policy-based authorization: Replace brittle role checks with composable authorization policies using roles and claims.
  • Multiple auth modes: Use OpenID Connect for external identity providers and ASP.NET Identity for user management.
  • Endpoint protection patterns: Require authorization at groups or per-endpoint level, while allowing specific public routes.
  • Secret handling & safety: Keep keys out of source control and never disable critical token validation.

Quick Start

Use the authentication skill to set up JWT bearer authentication and policy-based authorization for your ASP.NET Core API.

Frequently Asked Questions about authentication

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

FAQPage Schema
How do I set up JWT bearer token authentication in an ASP.NET Core API?

JWT bearer token authentication in ASP.NET Core validates issuer, audience, lifetime, and signing keys to secure API access. You configure token validation parameters and apply them to your API pipeline to protect endpoints.

What's the best way to enforce role- and claim-based authorization policies in ASP.NET Core?

Authorization policies in ASP.NET Core replace brittle role checks with composable rules using roles and claims. You define policies with requirements and handlers, then enforce them at the endpoint or group level.

Can I use OpenID Connect with ASP.NET Identity for external identity provider integration?

Yes, ASP.NET Core supports multiple authentication modes. You can use OpenID Connect for external identity providers alongside ASP.NET Identity for user management, enabling flexible authentication workflows.

How do I protect minimal API endpoints while keeping specific public routes accessible?

Endpoint protection patterns in ASP.NET Core let you require authorization at group or per-endpoint levels while allowing specific public routes. You apply authorization attributes or extension methods to control access.

Why should I never disable critical JWT token validation in production APIs?

Disabling critical JWT validation weakens API security by allowing forged or expired tokens. Safe secret management keeps signing keys out of source control, ensuring strict issuer, audience, and lifetime validation.

Does ASP.NET Core support multiple authentication schemes for REST API security?

ASP.NET Core supports multiple authentication modes including JWT bearer tokens and OpenID Connect. You can configure multiple schemes for REST API security, applying different authentication methods to different endpoints.