authentication-authorization-patterns

Configure OAuth 2.0, OpenID Connect, and JWT authentication in ASP.NET Core.

Updated Jan 23, 2026
One-click install
npx skills add https://github.com/alexsandrocruz/DominusLeads --skill authentication-authorization-patterns-alexsandrocruz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: authentication-authorization-patterns
Source: https://github.com/alexsandrocruz/DominusLeads/tree/main/backend/Sapienza.Leads/.claude/skills/authentication-authorization-patterns
Command: npx skills add https://github.com/alexsandrocruz/DominusLeads --skill authentication-authorization-patterns-alexsandrocruz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers and teams implement secure, scalable authentication and authorization patterns in .NET applications, reducing security risks and boilerplate code.

Core Features & Use Cases

  • OAuth 2.0 / OpenID Connect integration: Setup and configure modern login flows for web and API services.
  • JWT issuance and validation: Create and verify access tokens with proper claims and lifetimes.
  • RBAC and Claims-based Authorization: Enforce fine-grained access using roles and claims across APIs.
  • Refresh token rotation and token lifecycle: Improve security with rotating refresh tokens and policy-driven expiry.
  • Policy-based authorization and MFA patterns: Implement custom policies and multi-factor authentication workflows.
  • Use Case: Secure a healthcare API with Admin/Doctor roles and patient data access restrictions.

Quick Start

Configure OpenIddict in your ASP.NET Core service, define roles and policies, and integrate token generation and validation following the patterns described above.

Frequently Asked Questions about authentication-authorization-patterns

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

FAQPage Schema
How do I implement OAuth 2.0 and OpenID Connect login flows in ASP.NET Core?

Implement OAuth 2.0 and OpenID Connect in ASP.NET Core by configuring OpenIddict to handle login flows, token generation, and validation for web and API services. This provides modern authentication setup and reduces boilerplate security code.

How does RBAC and claims-based authorization work in .NET applications?

RBAC and claims-based authorization in .NET enforces fine-grained access control by defining roles and policies that restrict API resources based on user claims. This pattern secures endpoints across web APIs and services.

What is the best way to handle JWT refresh token rotation in .NET?

The best way to handle JWT refresh token rotation in .NET is implementing policy-driven token lifecycle logic with rotating refresh tokens. This approach improves application security by regularly expiring and renewing access tokens.

Does this authentication pattern support multi-factor authentication and custom policies?

Yes, this authentication pattern supports multi-factor authentication workflows and custom policy-driven access control in .NET. You can configure custom authorization policies to enforce MFA requirements across your web APIs and services.

Can I use OpenIddict and ABP Framework together for secure authentication?

Yes, you can use OpenIddict and ABP Framework together for secure authentication in ASP.NET Core. The code templates provide configuration patterns and role seeding specifically designed for both frameworks.