auth-implementation-patterns

Provides AuthN/AuthZ patterns and code for JWT, OAuth2, RBAC, and more.

2|Updated Jan 18, 2026
One-click install
npx skills add https://github.com/as4584/antigravity-skills --skill auth-implementation-patterns-as4584
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-implementation-patterns
Source: https://github.com/as4584/antigravity-skills/tree/main/agents-wshobson/plugins/developer-essentials/skills/auth-implementation-patterns
Command: npx skills add https://github.com/as4584/antigravity-skills --skill auth-implementation-patterns-as4584

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) and scripts (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and code examples for implementing secure and scalable authentication and authorization systems, addressing common security vulnerabilities and best practices.

Core Features & Use Cases

  • Authentication Strategies: Covers session-based, JWT-based, and OAuth2/OpenID Connect flows.
  • Authorization Models: Implements Role-Based Access Control (RBAC), permission-based checks, and resource ownership verification.
  • Security Best Practices: Details password security, rate limiting, secure cookie handling, and common pitfalls.
  • Use Case: When building a new web application, use this Skill to implement a secure user login system using JWTs and protect API endpoints with role-based access control.

Quick Start

Implement JWT authentication by using the provided TypeScript code examples for generating and verifying tokens within your Express.js application.

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 in an Express.js application?

To implement JWT authentication, use provided TypeScript code examples for generating and verifying tokens within your Express.js application. This secures user login systems by validating signed JSON Web Tokens.

What is the difference between session-based auth and OAuth2?

Session-based auth relies on server-stored session identifiers, while OAuth2 provides secure delegated access via token flows. This Skill covers both authentication strategies to address different application scaling and integration requirements.

How do I set up Role-Based Access Control to protect API endpoints?

To set up Role-Based Access Control (RBAC), apply the provided permission-based checks and resource ownership verification patterns to protect API endpoints. This restricts access to authorized user roles strictly.

What are the security best practices for password hashing and cookie management?

Security best practices for password hashing and cookie management involve implementing secure cookie handling and strong password hashing algorithms. These patterns prevent common vulnerabilities and protect user credentials effectively.

When should I use OAuth2 flows instead of JWT for authentication?

You should use OAuth2 flows instead of JWT when you need secure third-party delegated access or OpenID Connect integration. JWT is better suited for stateless API token verification within your own application.