auth-implementation-patterns

软件研发 工程流程 · 其它 2 文件 EN 原文

认证鉴权实现模式

Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems. Use when implementing auth systems, securing APIs, or debugging security issues.

说明语言:英文

来源wshobsonagents ↗ 查看原文件 ↗版权归原作者,请遵循原仓库许可
安装
npx skills add https://github.com/wshobson/agents --skill auth-implementation-patterns

需要已安装 skills CLI。也可以直接从源仓库 clone。

在星云中查看 ↗
SKILL.md 原文

name: auth-implementation-patterns description: Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems. Use when implementing auth systems, securing APIs, or debugging security issues. ---

Authentication & Authorization Implementation Patterns

Build secure, scalable authentication and authorization systems using industry-standard patterns and modern best practices.

When to Use This Skill

Core Concepts

1. Authentication vs Authorization

Authentication (AuthN): Who are you?

Authorization (AuthZ): What can you do?

2. Authentication Strategies

Session-Based:

Token-Based (JWT):

OAuth2/OpenID Connect:

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Best Practices

  1. Never Store Plain Passwords: Always hash with bcrypt/argon2
  2. Use HTTPS: Encrypt data in transit
  3. Short-Lived Access Tokens: 15-30 minutes max
  4. Secure Cookies: httpOnly, secure, sameSite flags
  5. Validate All Input: Email format, password strength
  6. Rate Limit Auth Endpoints: Prevent brute force attacks
  7. Implement CSRF Protection: For session-based auth
  8. Rotate Secrets Regularly: JWT secrets, session secrets
  9. Log Security Events: Login attempts, failed auth
  10. Use MFA When Possible: Extra security layer

Common Pitfalls

同类技能
ai-research-exploreai-research-reproductionairflow-dag-patternsanalyze-projectangular-migrationanti-reversing-techniquesapi-design-principlesarchitecture-patterns
本页内容来自开源项目 wshobson, 版权归原作者所有。
本站仅作技能索引与分享,所有 Skill 版权归其原作者所有。