Communityコーディング&開発github.com

mianhtsys/landingMod3

JWT、OAuth2、セッション管理、RBACを含む認証と認可のパターンを習得し、安全でスケーラブルなアクセス制御システムを構築します。認証システムの実装、APIの保護、セキュリティ問題のデバッグに使用します。

landingMod3 とは?

このスキルは、認証(Authentication)と認可(Authorization)の実装パターンに特化しており、JWT、OAuth2、セッション管理、ロールベースアクセス制御(RBAC)などの業界標準手法をカバーします。開発者は、ユーザー認証システムの実装、RESTやGraphQL APIの保護、ソーシャルログイン(Google、GitHubなど)の追加、シングルサインオン(SSO)やマルチテナンシーの設計など、幅広いユースケースで活用できます。このスキルは、セッションベース、トークンベース(JWT)、OAuth2/OpenID Connectといった主要な認証戦略を解説し、パスワードのハッシュ化、HTTPSの使用、短命なアクセストークン、セキュアクッキー、レート制限、CSRF保護、シークレットの定期的なローテーション、セキュリティイベントのログ記録、MFAの導入など、具体的なベストプラクティスを提供します。また、弱いパスワード、JWTのlocalStorage保存、トークンの無期限化、クライアント側のみの認証チェック、安全でないパスワードリセット、レート制限の欠如、クライアントデータの過信など、よくある落とし穴を回避するための指針も示します。さらに、より詳細なパターン情報は `references/details.md` に保存されており、必要に応じて参照できます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mianhtsys/landingMod3/tree/HEAD/MODULO_3_DESARROLLO_AL_LADO_DEL_CLIENTE_Y_SERVIDOR_WEB/architecture-skills-framework/.agents/skills/auth-implementation-patterns

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

認証と認可の実装パターン

業界標準のパターンと最新のベストプラクティスを使用して、安全でスケーラブルな認証および認可システムを構築します。

このスキルを使用すべき場合

  • ユーザー認証システムの実装
  • RESTまたはGraphQL APIの保護
  • OAuth2/ソーシャルログインの追加
  • ロールベースアクセス制御(RBAC)の実装
  • セッション管理の設計
  • 認証システムの移行
  • 認証問題のデバッグ
  • SSOまたはマルチテナンシーの実装

中核となる概念

1. 認証 vs 認可

認証(AuthN):あなたは誰ですか?

  • 身元の確認(ユーザー名/パスワード、OAuth、生体認証)
  • 資格情報の発行(セッション、トークン)
  • ログイン/ログアウトの管理

認可(AuthZ):何ができますか?

  • 権限の確認
  • ロールベースアクセス制御(RBAC)
  • リソース所有権の検証
  • ポリシーの実施

2. 認証戦略

セッションベース:

  • サーバーがセッション状態を保存
  • セッションIDをクッキーに保存
  • 従来型、シンプル、ステートフル

トークンベース(JWT):

  • ステートレス、自己完結型
  • 水平スケーリング可能
  • クレームを格納可能

OAuth2/OpenID Connect:

  • 認証の委任
  • ソーシャルログイン(Google、GitHub)
  • エンタープライズSSO

詳細なパターンと実践例

詳細なパターン文書は references/details.md に保存されています。上記のナビゲーション階層では不十分な場合は、そのファイルを読んでください。

ベストプラクティス

  1. パスワードを平文で保存しない: 常にbcrypt/argon2でハッシュ化する
  2. HTTPSを使用する: 転送中のデータを暗号化する
  3. 短命なアクセストークン: 最大15~30分
  4. セキュアクッキー: httpOnly、secure、sameSiteフラグ
  5. すべての入力を検証する: メール形式、パスワード強度
  6. 認証エンドポイントにレート制限をかける: ブルートフォース攻撃を防ぐ
  7. CSRF保護を実装する: セッションベース認証の場合
  8. シークレットを定期的にローテーションする: JWTシークレット、セッションシークレット
  9. セキュリティイベントをログに記録する: ログイン試行、認証失敗
  10. 可能な場合はMFAを使用する: 追加のセキュリティ層

よくある落とし穴

  • 弱いパスワード: 強力なパスワードポリシーを施行する
  • localStorageへのJWT保存: XSSに対して脆弱、httpOnlyクッキーを使用する
  • トークンの有効期限なし: トークンには有効期限を設定する
  • クライアント側のみの認証チェック: 常にサーバー側で検証する
  • 安全でないパスワードリセット: 有効期限付きのセキュアなトークンを使用する
  • レート制限なし: ブルートフォース攻撃に対して脆弱
  • クライアントデータの信頼: 常にサーバー側で検証する

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

mianhtsys/landingMod3

Implement WCAG 2.2 compliant interfaces with mobile accessibility, inclusive design patterns, and assistive technology support. Use when auditing accessibility, implementing ARIA patterns, building for screen readers, or ensuring inclusive user experiences.

mianhtsys/landingMod3

Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.

mianhtsys/landingMod3

Diseña y compara alternativas arquitectónicas trazables a RF/RNF sin implementar código.

mianhtsys/landingMod3

Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.

mianhtsys/landingMod3

Revisión adversarial de la arquitectura contra RF/RNF, detectando contradicciones, cobertura faltante y complejidad innecesaria.

mianhtsys/landingMod3

>- Generate grounded-and-verified, engine-agnostic database documentation that reaches 100% parity with the real schema. Introspects the LIVE database as ground truth and cross-validates it against ORM models, migrations, generated types, seeds, and application queries, then proves completeness by diffing the docs back against the database. Produces ER diagrams (mermaid), per-table data dictionaries, and a machine-readable schema.json. Works with PostgreSQL, MySQL, SQL Server, and SQLite across any ORM (Prisma, TypeORM, Drizzle, Sequelize, Knex, Django, Rails) or raw SQL. Use when asked to document a database, produce an ERD or data dictionary, write db/schema docs, audit schema drift, or refresh existing DB docs.

mianhtsys/landingMod3

Compara estrategias de persistencia y motores de datos según consistencia, concurrencia, volumen, recuperación y operación.

mianhtsys/landingMod3

Design robust, scalable database schemas for SQL and NoSQL databases. Provides normalization guidelines, indexing strategies, migration patterns, constraint design, and performance optimization. Ensures data integrity, query performance, and maintainable data models.

mianhtsys/landingMod3

Consolida análisis especializados en una recomendación arquitectónica, matriz de decisión, ADR y plan de validación.

mianhtsys/landingMod3

Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.

mianhtsys/landingMod3

Build and maintain web frontends — component architecture, state management, API integration, responsive layout, client-side performance, and frontend testing patterns. Framework agnostic, focused on web frontend implementation. Do not use for backend service implementation, data engineering, or platform infrastructure work.

mianhtsys/landingMod3

Evalúa despliegue, contenedores, escalado, alta disponibilidad, observabilidad, backup, recuperación y CI/CD de forma proporcional.

mianhtsys/landingMod3

Execute read-only SQL queries against multiple Microsoft SQL Server databases. Use when: (1) querying MSSQL/SQL Server databases, (2) exploring database schemas/tables, (3) running SELECT queries for data analysis, (4) checking database contents. Supports multiple database connections with descriptions for intelligent auto-selection. Blocks all write operations (INSERT, UPDATE, DELETE, DROP, etc.) for safety.

mianhtsys/landingMod3

Generate and maintain OpenAPI 3.1 specifications from code, design-first specs, and validation patterns. Use when creating API documentation, generating SDKs, or ensuring API contract compliance.

mianhtsys/landingMod3

PHP 8.0+ development — XAMPP, RESTful APIs, PDO/MySQL/MariaDB, and authentication. Use when building PHP backends, creating API endpoints, configuring XAMPP, or integrating PHP with databases.

mianhtsys/landingMod3

Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features

mianhtsys/landingMod3

Analiza requisitos funcionales y no funcionales, reglas, restricciones, capacidad y ambigüedades antes de seleccionar tecnologías.

mianhtsys/landingMod3

Implement modern responsive layouts using container queries, fluid typography, CSS Grid, and mobile-first breakpoint strategies. Use when building adaptive interfaces, implementing fluid layouts, or creating component-level responsive behavior.

mianhtsys/landingMod3

>- Use when designing or implementing software securely: define security requirements, threat-model a feature, choose secure defaults, design authentication and authorization, handle untrusted data and secrets, evaluate dependencies, design multi-tenant trust boundaries, or review security-sensitive changes. Use for prevention during requirements, design, implementation, and review; not for post-build security assessments or scanning an existing codebase.

mianhtsys/landingMod3

Revisa seguridad arquitectónica, identidad, autorización, secretos, APIs, auditoría, fraude y resiliencia antes de implementar.

関連スキル