jwt

Implement JWT Bearer authentication and authorization policies for Sorcha services.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/StuartF303/Sorcha --skill jwt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jwt
Source: https://github.com/StuartF303/Sorcha/tree/main/.claude/skills/jwt
Command: npx skills add https://github.com/StuartF303/Sorcha --skill jwt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Implements JWT Bearer authentication across Sorcha services to securely identify users and services, enabling policy-based access control.

Core Features & Use Cases

  • Provides support for user, service, and delegated token types with shared issuer settings.
  • Enables issuing, validating, and revoking tokens using a consistent JwtSettings source.
  • Integrates with ASP.NET Core authentication and authorization to protect endpoints and enforce policies.

Quick Start

  1. Ensure Sorcha.ServiceDefaults is referenced and that JWT authentication is enabled in Program.cs.
  2. Protect endpoints with .RequireAuthorization() and define policies to enforce access rules.
  3. Issue and validate tokens for user or service clients and test 401/403 responses.

Frequently Asked Questions about jwt

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

FAQPage Schema
How do I implement JWT authentication for ASP.NET Core microservices?

JWT authentication in ASP.NET Core involves configuring Bearer token validation in Program.cs using shared JwtSettings, protecting endpoints with .RequireAuthorization(), and defining authorization policies. The Skill integrates with ASP.NET Core's standard authentication pipeline to validate tokens across services and enforce access control rules.

What are the differences between user, service, and delegated JWT token types?

JWT token types serve different authentication scenarios: user tokens identify end users, service tokens authenticate service-to-service communication, and delegated tokens enable one service to act on behalf of another. The Skill supports all three types using consistent JwtSettings configuration across Sorcha services.

How do I issue and validate JWT tokens in a multi-tenant environment?

Issue tokens by generating a Bearer token with the appropriate claims for your tenant context. Validate tokens by configuring ASP.NET Core authentication middleware with shared issuer settings from Sorcha.ServiceDefaults. The Skill handles token validation and applies tenant isolation within authorization policies.

Why am I getting 401 and 403 errors when accessing protected endpoints?

401 errors indicate missing or invalid JWT tokens; 403 errors mean the token is valid but lacks required authorization claims. Verify token validity, check that endpoints have .RequireAuthorization() applied, and confirm authorization policies match the token's claims and tenant context.

Do I need Sorcha.ServiceDefaults to use JWT authentication?

Yes, Sorcha.ServiceDefaults provides the shared JwtSettings configuration required for consistent token issuing and validation across services. The Skill relies on this dependency to maintain a single source of truth for JWT authentication parameters in your microservice architecture.

Can I revoke or invalidate JWT tokens after they're issued?

JWT tokens are stateless by design and cannot be revoked until expiration. The Skill supports token revocation strategies through authorization policies that check against external blocklists or invalidation sources, enabling you to deny access to tokens before their expiration time.