auth-implementation-patterns

Implement JWT refresh flows and RBAC authorization for REST or GraphQL APIs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you build and troubleshoot authentication and authorization systems so you can prevent insecure access, broken sessions, and misapplied permissions.

Core Features & Use Cases

  • JWT Authentication: Implement signed access tokens and refresh-token flows with clear validation boundaries.
  • Session-Based Authentication: Set up server-managed sessions (optionally with Redis) to reduce stateless token risks.
  • OAuth2 / Social Login: Integrate delegated identity for Google/GitHub and enterprise SSO-style flows.
  • Authorization Controls: Apply RBAC, permission checks, and resource ownership validation to enforce correct access.

Quick Start

Use this skill to design a complete JWT access + refresh implementation with RBAC-protected routes for your API.

Frequently Asked Questions about auth-implementation-patterns

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

FAQPage Schema
How do I implement JWT authentication with refresh tokens in my API?

JWT authentication with refresh tokens is implemented by issuing signed access tokens and refresh-token flows with clear validation boundaries. You enforce correct token verification, expiry, and secure middleware to manage authentication consistently across REST or GraphQL APIs.

What is the best way to enforce RBAC and permission checks during authorization?

The best way to enforce RBAC and permission checks is by applying resource ownership validation and role-based access control middleware. This ensures correct access enforcement and prevents insecure access control by validating user permissions before allowing route access.

Can I use OAuth2 social login for Google, GitHub, and enterprise SSO?

Yes, you can integrate OAuth2 delegated identity for Google, GitHub, and enterprise SSO-style flows. This approach allows your REST or GraphQL API to rely on external identity providers to manage secure authentication and prevent broken sessions.

Does session-based authentication with Redis reduce stateless token risks?

Session-based authentication with Redis reduces stateless token risks by using server-managed sessions. This approach validates sessions centrally, helping to prevent misapplied permissions and insecure access control better than relying solely on client-side stateless tokens.

How do I prevent insecure access control and session token failures in API security?

To prevent insecure access control and session token failures, you must require secure password handling, correct token expiry, and rate limiting. Implementing consistent authentication middleware and authorization checks ensures API security against broken sessions.