Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计未展示

auth-patterns授权模式

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

445

周安装

18

GitHub Stars

公开资料未说明

下载量

140
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:auth-patterns(授权模式)
来源仓库:https://github.com/yonatangross/skillforge-claude-plugin
仓库路径:skills/auth-patterns
安装命令:
npx skills add yonatangross/skillforge-claude-plugin --skill "auth-patterns"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add yonatangross/skillforge-claude-plugin --skill "auth-patterns"

简介

auth-patterns 用于辅助安全审计和权限检查。

  • 它适合梳理敏感配置、检查依赖风险或分析鉴权逻辑。
  • 通过 npx skills add yonatangross/skillforge-claude-plugin --skill "auth-patterns" 安装使用。
  • 使用时不能把工具输出直接当最终结论,涉及密钥时应先确认最小权限。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Authentication Patterns

Implement secure authentication with OAuth 2.1, Passkeys, and modern security standards.

Overview

  • Login/signup flows
  • JWT token management
  • Session security
  • OAuth 2.1 with PKCE
  • Passkeys/WebAuthn
  • Multi-factor authentication
  • Role-based access control

Quick Reference

Password Hashing (Argon2id)

from argon2 import PasswordHasher
ph = PasswordHasher()
password_hash = ph.hash(password)
ph.verify(password_hash, password)

JWT Access Token

import jwt
from datetime import datetime, timedelta, timezone
payload = {
    'user_id': user_id,
    'type': 'access',
    'exp': datetime.now(timezone.utc) + timedelta(minutes=15),
}
token = jwt.encode(payload, SECRET_KEY, algorithm='HS256')

OAuth 2.1 with PKCE (Required)

import hashlib, base64, secrets
code_verifier = secrets.token_urlsafe(64)
digest = hashlib.sha256(code_verifier.encode()).digest()
code_challenge = base64.urlsafe_b64encode(digest).rstrip(b'=').decode()

Session Security

app.config['SESSION_COOKIE_SECURE'] = True      # HTTPS only
app.config['SESSION_COOKIE_HTTPONLY'] = True    # No JS access
app.config['SESSION_COOKIE_SAMESITE'] = 'Strict'

Token Expiry (2026 Guidelines)

Token TypeExpiryStorage
Access15 min - 1 hourMemory only
Refresh7-30 daysHTTPOnly cookie

Anti-Patterns (FORBIDDEN)

# ❌ NEVER store passwords in plaintext
user.password = request.form['password']

# ❌ NEVER use implicit OAuth grant
response_type=token  # Deprecated in OAuth 2.1

# ❌ NEVER skip rate limiting on login
@app.route('/login')  # No rate limit!

# ❌ NEVER reveal if email exists
return "Email not found"  # Information disclosure

# ✅ ALWAYS use Argon2id or bcrypt
password_hash = ph.hash(password)

# ✅ ALWAYS use PKCE
code_challenge=challenge&code_challenge_method=S256

# ✅ ALWAYS rate limit auth endpoints
@limiter.limit("5 per minute")

# ✅ ALWAYS use generic error messages
return "Invalid credentials"

Key Decisions

DecisionRecommendation
Password hashArgon2id > bcrypt
Access token expiry15 min - 1 hour
Refresh token expiry7-30 days with rotation
Session cookieHTTPOnly, Secure, SameSite=Strict
Rate limit5 attempts per minute
MFAPasskeys > TOTP > SMS
OAuth2.1 with PKCE (no implicit)

Detailed Documentation

ResourceDescription
references/oauth-2.1-passkeys.mdOAuth 2.1, PKCE, Passkeys/WebAuthn
examples/auth-implementations.mdComplete implementation examples
checklists/auth-checklist.mdSecurity checklist
scripts/auth-middleware-template.pyFlask/FastAPI middleware

Related Skills

  • owasp-top-10 - Security fundamentals
  • input-validation - Data validation
  • api-design-framework - API security

Capability Details

password-hashing

Keywords: password, hashing, bcrypt, argon2, hash Solves:

  • Securely hash passwords with modern algorithms
  • Configure appropriate cost factors
  • Migrate legacy password hashes

jwt-tokens

Keywords: JWT, token, access token, claims, jsonwebtoken Solves:

  • Generate and validate JWT access tokens
  • Implement proper token expiration
  • Handle token refresh securely

oauth2-pkce

Keywords: OAuth, PKCE, OAuth 2.1, authorization code, code verifier Solves:

  • Implement OAuth 2.1 with PKCE flow
  • Secure authorization for SPAs and mobile apps
  • Handle OAuth provider integration

passkeys-webauthn

Keywords: passkey, WebAuthn, FIDO2, passwordless, biometric Solves:

  • Implement passwordless authentication
  • Configure WebAuthn registration and login
  • Support cross-device passkeys

session-management

Keywords: session, cookie, session storage, logout, invalidate Solves:

  • Manage user sessions securely
  • Implement session invalidation on logout
  • Handle concurrent sessions

role-based-access

Keywords: RBAC, role, permission, authorization, access control Solves:

  • Implement role-based access control
  • Define permission hierarchies
  • Check authorization in routes

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

27.97%
按下载量换算39

OpenCode

21.69%
按下载量换算30

Antigravity

15.9%
按下载量换算22

Gemini CLI

13.42%
按下载量换算19

windsurf

7.51%
按下载量换算11

trae

3.46%
按下载量换算5

安全审计

暂无安全审计结果可展示。

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills