跳到正文
Skillpedia
安全48k · #3841

auth-implementation-patterns

它能做什么

这个工具可以帮你设计和审查应用的安全体系,确保只有获得授权的用户才能访问特定的信息和功能。

适用场景

  • ✓给应用搭建用户登录系统时。
  • ✓想保护应用信息,防止未经授权的访问时。
  • ✓需要添加“使用 Google 登录”或“使用 Facebook 登录”这类登录方式时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/auth-implementation-patterns/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/auth-implementation-patterns/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“帮我设置安全规则,让只有管理员才能查看销售报表。”

每周 5 个新技能,1 分钟读完。

工作原理

它会分析你的应用如何处理登录和权限,并给出最合适的方案,帮你保护数据,同时控制每个用户能做什么。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Authentication & Authorization Implementation Patterns

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

Use this skill when

  • Implementing user authentication systems
  • Securing REST or GraphQL APIs
  • Adding OAuth2/social login or SSO
  • Designing session management or RBAC
  • Debugging authentication or authorization issues

Do not use this skill when

  • You only need UI copy or login page styling
  • The task is infrastructure-only without identity concerns
  • You cannot change auth policies or credential storage

Instructions

  • Define users, tenants, flows, and threat model constraints.
  • Choose auth strategy (session, JWT, OIDC) and token lifecycle.
  • Design authorization model and policy enforcement points.
  • Plan secrets storage, rotation, logging, and audit requirements.
  • If detailed examples are required, open resources/implementation-playbook.md.

Safety

  • Never log secrets, tokens, or credentials.
  • Enforce least privilege and secure storage for keys.

Resources

  • resources/implementation-playbook.md for detailed patterns and examples.

Worked example

Input: an Express application accepts a user's login and keeps the pre-login session ID. Read the bundled playbook, regenerate the session after credential verification, save only required identity fields, and verify that the old cookie cannot access /api/profile. Also test failed login, logout and store failure. Expected: successful login changes the session ID; failed login grants no access.

Inputs and prerequisites

Record the installed framework/SDK versions, identity provider, tenant model, credential store and test environment. Supply project-specific database adapters and request schemas; examples are integration sketches, not a runnable identity service.

Limitations

  • JWT validation does not establish resource ownership; enforce tenant and object policy on reads and writes.
  • Refresh rotation requires atomic persistence and concurrency tests; the issuance example alone does not provide it.
  • Cookie flags do not replace CSRF protection, and secure-cookie behavior needs the actual HTTPS/proxy configuration tested.
  • Provider integrations and password policies must be checked against current primary documentation and the application's threat model.
常见问题

“token”“会话(session)”和“资源访问边界”是什么意思?

这些都是应用的工作方式:会话或令牌用来记住你是谁,访问边界则规定你被允许做什么。

什么是 RBAC?

全称是 Role-Based Access Control,即基于角色的访问控制。不同类型的用户拥有不同的权限,例如管理员和普通用户。

什么是 OAuth2 或 SSO?

这两者都是更方便的登录方式:OAuth2 允许你用已有账号(比如 Google 账号)去访问其他应用;SSO(单点登录)则让你用一个账号登录多个应用。

详情

作者的原始描述

Implement or review authentication and authorization with explicit token, session and resource-access boundaries.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#3841
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能