auth-implementation-patterns

Implement JWT, OAuth2, session, and RBAC authentication patterns for APIs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Securely designing and implementing authentication and authorization for modern applications can be complex, error-prone, and risky if patterns aren't standardized across services.

Core Features & Use Cases

  • JWT-based authentication with access and refresh tokens for stateless APIs
  • Session-based and OAuth2/OpenID Connect integration for flexible sign-in
  • Role-based access control (RBAC) and permission checks to enforce least privilege
  • Password handling, rate limiting, and security best practices to reduce attack surface
  • Use Case: secure a REST API, a GraphQL endpoint, or a multi-tenant service with centralized auth

Quick Start

Start by selecting a pattern (JWT, session, or OAuth2) and integrate a secure auth flow into 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 access and refresh tokens for a stateless API?

OAuth2 and OpenID Connect integration enables flexible sign-in for applications by delegating authentication to external providers. This approach supports REST APIs, GraphQL endpoints, and web apps without managing password storage directly.

What is the best way to enforce role-based access control and permission checks in a multi-tenant service?

Authentication patterns for multi-tenant services must centralize authorization logic to support REST and GraphQL APIs. This Skill implements RBAC, OAuth2, and session management to securely isolate tenants and enforce permission checks across endpoints.

How does session management differ from JWT for securing REST APIs?

Session-based authentication maintains server-side state, unlike stateless JWT authentication which passes tokens with each API request. Both approaches require secure handling and rate limiting to protect REST APIs from unauthorized access.

What security practices are required when implementing authentication and authorization?

Required security practices include password hashing, rate limiting, and short-lived access tokens with refresh tokens. Authorization requires permission checks and RBAC to enforce least privilege across REST APIs and GraphQL endpoints.

Can I use OAuth2 and OpenID Connect for flexible sign-in across web apps and APIs?

OAuth2 and OpenID Connect support flexible sign-in across web apps and APIs by delegating authentication to identity providers. This enables secure access without handling passwords directly, applying to REST, GraphQL, and multi-tenant services.