auth-and-authorization-patterns

Implement OAuth2/OIDC authentication with JWT validation and RBAC/ABAC access control.

1|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/edwifiguy/era-agents-ops --skill auth-and-authorization-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-and-authorization-patterns
Source: https://github.com/edwifiguy/era-agents-ops/tree/main/skills/era-agents-op/metaclaw/memory_data/skills/auth-and-authorization-patterns
Command: npx skills add https://github.com/edwifiguy/era-agents-ops --skill auth-and-authorization-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use this skill when implementing authentication (login, token issuance) or authorization (access control, permissions). Apply whenever the task involves login flows, JWT, OAuth2, session management, or RBAC.

Core Features & Use Cases

  • Authentication and authorization best practices for secure systems.
  • Guidance for implementing login flows, token handling, MFA, RBAC/ABAC, and session management.
  • Real-world example: A web app with user roles and access to protected resources, using OAuth2/OIDC flow and refresh tokens.

Quick Start

Configure a new application to authenticate users with OAuth2/OIDC, issue tokens, and enforce role-based access control.

Frequently Asked Questions about auth-and-authorization-patterns

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

FAQPage Schema
How do I implement secure OAuth2 and OIDC login flows with PKCE?

Secure OAuth2 and OIDC login flows with PKCE involve issuing tokens and validating their lifecycles. This pattern provides protected resource access by enforcing correct authorization code exchanges and session management.

What is the best way to enforce RBAC and ABAC access control in web applications?

Enforcing RBAC and ABAC access control in web applications requires applying permission checks during user authentication. This method provides secure resource protection by validating user roles and attributes before granting access to protected endpoints.

How do I manage JWT validation and refresh token lifecycles securely?

Managing JWT validation and refresh token lifecycles securely involves validating token signatures and automating token refresh processes. This ensures continuous session validity and prevents unauthorized access from expired or compromised tokens.

Does this approach support adding MFA to existing authentication workflows?

Adding MFA to existing authentication workflows is supported through dedicated implementation guidance. This integration provides an additional security layer by requiring secondary verification factors during the user login process.

When should I use OAuth2 over standard session management for API authentication?

Use OAuth2 over standard session management for API authentication when handling third-party access or decentralized services. OAuth2 provides scoped token-based delegation, which is more scalable across multiple APIs than stateful server sessions.