Agent Skillsaiming-lab/MetaClaw › auth-and-authorization-patterns

auth-and-authorization-patterns

GitHub

提供身份认证与授权最佳实践,涵盖密码哈希、JWT/OAuth2流程、RBAC/ABAC权限控制及会话安全管理。适用于实现登录、令牌签发、访问控制及安全合规场景。

memory_data/skills/auth-and-authorization-patterns/SKILL.md aiming-lab/MetaClaw

Trigger Scenarios

实现用户登录或注册流程 配置JWT或OAuth2认证 设计基于角色的访问控制(RBAC) 处理会话管理与安全加固

Install

npx skills add aiming-lab/MetaClaw --skill auth-and-authorization-patterns -g -y
More Options

Non-standard path

npx skills add https://github.com/aiming-lab/MetaClaw/tree/main/memory_data/skills/auth-and-authorization-patterns -g -y

Use without installing

npx skills use aiming-lab/MetaClaw@auth-and-authorization-patterns

指定 Agent (Claude Code)

npx skills add aiming-lab/MetaClaw --skill auth-and-authorization-patterns -a claude-code -g -y

安装 repo 全部 skill

npx skills add aiming-lab/MetaClaw --all -g -y

预览 repo 内 skill

npx skills add aiming-lab/MetaClaw --list

SKILL.md

Frontmatter
{
    "name": "auth-and-authorization-patterns",
    "category": "security",
    "description": "Use this skill when implementing authentication (login, token issuance) or authorization (access control, permissions). Apply whenever the task involves login flows, JWT, OAuth2, session management, or RBAC."
}

Auth & Authorization Patterns

Authentication (who are you?):

  • Use a battle-tested library — do not roll your own crypto.
  • Hash passwords with bcrypt/argon2; never MD5/SHA1 for passwords.
  • Use short-lived JWTs (15–60 min) with refresh tokens; store refresh tokens securely.
  • Implement MFA for sensitive operations.

Authorization (what can you do?):

  • Check authorization on every request, not just at login.
  • Enforce RBAC or ABAC at the service layer, not the UI.
  • Apply principle of least privilege: grant minimal permissions needed.

OAuth2 / OIDC:

  • Use the Authorization Code flow with PKCE for user-facing apps.
  • Validate iss, aud, exp, and nonce claims on every token.

Session management:

  • Regenerate session ID after login (session fixation prevention).
  • Set HttpOnly and Secure flags on session cookies.

Version History

  • 922caf3 Current 2026-07-25 11:07

Same Skill Collection

memory_data/skills/agent-task-handoff/SKILL.md
memory_data/skills/async-communication-etiquette/SKILL.md
memory_data/skills/audience-aware-communication/SKILL.md
memory_data/skills/avoid-acting-on-assumptions/SKILL.md
memory_data/skills/avoid-hallucinating-specifics/SKILL.md
memory_data/skills/avoid-scope-creep/SKILL.md
memory_data/skills/clarify-ambiguous-requests/SKILL.md
memory_data/skills/codebase-navigation/SKILL.md
memory_data/skills/context-window-management/SKILL.md
memory_data/skills/data-validation-first/SKILL.md
memory_data/skills/debug-systematically/SKILL.md
memory_data/skills/do-not-retry-without-diagnosis/SKILL.md
memory_data/skills/git-workflow/SKILL.md
memory_data/skills/graceful-error-recovery/SKILL.md
memory_data/skills/idempotent-script-design/SKILL.md
memory_data/skills/input-validation-and-sanitization/SKILL.md
memory_data/skills/plan-before-multi-step-execution/SKILL.md
memory_data/skills/prioritize-by-impact/SKILL.md
memory_data/skills/professional-email-drafting/SKILL.md
memory_data/skills/robust-error-handling-in-scripts/SKILL.md
memory_data/skills/secrets-management/SKILL.md
memory_data/skills/secure-code-review/SKILL.md
memory_data/skills/source-evaluation/SKILL.md
memory_data/skills/sql-best-practices/SKILL.md
memory_data/skills/structured-logging-and-observability/SKILL.md
memory_data/skills/structured-progress-update/SKILL.md
memory_data/skills/structured-research-workflow/SKILL.md
memory_data/skills/structured-step-by-step-reasoning/SKILL.md
memory_data/skills/task-decomposition/SKILL.md
memory_data/skills/technical-writing-clarity/SKILL.md
memory_data/skills/test-before-ship/SKILL.md
memory_data/skills/tool-selection-strategy/SKILL.md
memory_data/skills/uncertainty-acknowledgment/SKILL.md
memory_data/skills/verify-before-irreversible-action/SKILL.md
memory_data/skills/visualization-selection/SKILL.md

Metadata

Files
0
Version
922caf3
Hash
94970a37
Indexed
2026-07-25 11:07

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 11:59
浙ICP备14020137号-1 $방문자$