auth-implementation-patterns

Standardize JWT, session, OAuth2, and RBAC authentication patterns for REST, GraphQL, and microservices.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/caicedov/netwatch --skill auth-implementation-patterns-caicedov
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-implementation-patterns
Source: https://github.com/caicedov/netwatch/tree/main/.github/skills/auth-implementation-patterns
Command: npx skills add https://github.com/caicedov/netwatch --skill auth-implementation-patterns-caicedov

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill consolidates best-practice authentication and authorization patterns to help developers build secure, scalable access control systems across modern applications.

Core Features & Use Cases

  • AuthN/AuthZ patterns: covers JWT-based, session-based, OAuth2/OpenID Connect, and RBAC/ABAC approaches for REST, GraphQL, and microservices.
  • Security guidance: provides middleware strategies, token handling, and least-privilege design.
  • Use Case: Imagine building a multi-tenant SaaS where you need per-user authentication, role-based access, and secure token refresh flows. This skill guides implementing these patterns end-to-end.

Quick Start

Implement a basic authentication flow (login, logout, protect a route) using JWT tokens in cookies and apply RBAC to a protected endpoint.

Frequently Asked Questions about auth-implementation-patterns

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

FAQPage Schema
What's the best way to implement JWT-based authentication for REST APIs?

JWT-based authentication for REST APIs is standardized using concrete middleware patterns that handle token generation, validation, and secure cookie storage to protect endpoints. It ensures scalable access control across services.

How do I apply RBAC authorization to protected routes in a microservices architecture?

RBAC authorization for protected routes is implemented via least-privilege design patterns and middleware strategies. This ensures role-based access control is consistently enforced across microservices, REST, and GraphQL endpoints.

Does this approach support OAuth2 and OpenID Connect for multi-tenant SaaS applications?

OAuth2 and OpenID Connect are fully supported for multi-tenant SaaS applications. The approach provides secure token refresh flows and per-user authentication strategies tailored for scalable, multi-tenant environments.

When should I use session-based authentication instead of JWT tokens?

Session-based authentication should be used instead of JWT tokens when you need strict server-side session invalidation and centralized session management over stateless token validation across distributed microservices.

How do I handle secure token refresh flows for modern web applications?

Secure token refresh flows for modern web applications are handled using established security best practices and middleware patterns. This covers token lifecycle management, secure cookie handling, and preventing unauthorized access.

Can I use ABAC authorization patterns for GraphQL endpoints?

ABAC authorization patterns can be applied to GraphQL endpoints using attribute-based middleware strategies. This provides fine-grained, policy-driven access control compared to broader role-based models across your API layer.