본문으로 건너뛰기
cccskills
무료GitHub에 공개

auth-strategy

Auth decision guide: OAuth2/OIDC+PKCE, JWT rotation, RBAC/ABAC/ReBAC, token storage, revocation, MFA, sessions.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SebastianLuser/claude-code-arcane스타 3(GitHub 3 + cccskills 0)

실행 점수 미검증

설치 방법 보기

포함된 파일(2)

  • SKILL.md5.2 KB
  • references/anti-patterns.md1.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

auth-strategy — Authentication + Authorization Decision Guide

MANDATORY WORKFLOW

Antes de recomendar o implementar cualquier estrategia de auth, completar estos pasos en orden.

Step 0: Gather Requirements

Clarificar (o inferir del contexto si ya fue especificado):

  1. Stack: Go + TS / pure TS / otro
  2. ¿Auth nueva o migración de existente? (si es migración, revisar implementación actual)
  3. ¿Multi-tenant? → define si necesita tenant scope en tokens y middleware
  4. ¿OAuth provider externo (Google, GitHub, etc.) o auth propio?
  5. ¿MFA requerido? ¿Para todos o solo roles admin/privilegiados?

Si el usuario ya especificó estos valores, saltar directamente al Step 1.

Step 1: Recomendar estrategia

Usar las tablas de OAuth / JWT / Authorization más abajo. Elegir el modelo correcto para el contexto. Explicar en 1-2 oraciones por qué.

Step 2: Implementar + Verificar

Implementar. Al terminar, validar contra el Checklist al final de este documento.


Pipeline: Authentication (who) -> Token (proof) -> Authorization (what they can do).

1. OAuth 2.0 / OIDC

FlowUse
Auth Code + PKCE (S256)Default for ALL clients (SPA, mobile, server)
Client CredentialsServer-to-server / M2M only
Implicit / Password GrantNEVER — deprecated

Always use PKCE even with client_secret. Validate state (CSRF), nonce (in id_token), code_challenge S256 (never plain), redirect_uri exact HTTPS (no wildcards). Verify id_token signature via JWKS + iss + aud + exp + nonce. Post-login: id_token is NOT a session token — create your own session.

2. JWT Strategy

AlgorithmWhenAvoid
RS256Default, broad interop—
EdDSAPerformance, smaller tokensIf consumers lack Ed25519
HS256Single service onlyMulti-service (shared secret)
alg: noneNEVER—

Lifetimes: Access 5-15 min. Refresh 7-30 days, rotated every use.

Refresh rotation: Track by family_id. On use: mark rotated, issue new with same family. Reuse of rotated token -> revoke entire family (theft detected).

Revocation: user_version claim (scales better — password/role change increments version) or blacklist jti with TTL (+1 cache hit/request).

JWKS: Expose /.well-known/jwks.json, rotate every 90 days with two active kid.

Storage:

PlatformAccessRefresh
Web SPAIn-memory (JS var)HttpOnly+Secure+SameSite=Lax cookie
MobileSecureStore (Keychain/Keystore)SecureStore
NEVERlocalStorage, sessionStorage, AsyncStorage—

Claims: Only sub (UUID) + authorization claims. Never PII — especially with minors.

3. Authorization Model

ModelWhenComplexity
RBAC + tenant scopeDefault (~80% of apps)Low
ABAC (Casbin)Dynamic context rules (time, state, resource props)Medium
ReBAC (OpenFGA/SpiceDB)Granular sharing (Google Docs-style)High

Start RBAC. Migrate to ABAC only when static roles can't express rules. Permission naming: resource:action (e.g., post:write). Never roles as permissions. Middleware order: auth -> tenant scope -> permission -> ownership (service layer). Ownership checks live in service layer (need business context). RLS is defense-in-depth (complements middleware, never replaces). Frontend auth is UX-only — backend ALWAYS validates. Cache permissions per user+tenant, TTL ~5 min, invalidate on role change.

4. MFA + Session Management

MFA triggerMethod
Admin/privileged rolesTOTP (broad support)
Phishing resistance neededWebAuthn/passkeys
Sensitive actions (delete, export, payment)Step-up re-prompt

Sessions: Concurrent limits per user/tenant. Absolute expiry (24h) + idle timeout (30 min). Invalidate on password/role change. Server-side storage, client holds opaque ID only.

Anti-patterns

→ Read references/anti-patterns.md for the full 17-item checklist.

Checklist

  • Auth Code + PKCE (S256), state + nonce validated
  • id_token verified (JWKS + iss + aud + exp + nonce)
  • redirect_uri exact HTTPS, client_secret backend-only
  • Own session post-OAuth (not reusing id_token)
  • RS256/EdDSA, access <=15min, refresh rotated with family tracking
  • JWKS endpoint with 90-day rotation
  • Revocation via blacklist jti or user_version
  • Storage: HttpOnly cookie / in-memory / SecureStore per platform
  • Permissions as resource:action, middleware: auth->scope->permission
  • Ownership in service layer, RLS as defense-in-depth
  • Permission cache with invalidation on role change

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Plan, design, and implement A/B tests and experiments with statistical rigor. Covers hypothesis frameworks, sample sizing, metrics, and result analysis.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SebastianLuser/claude-code-arcane32026년 10월 27일 업데이트

Web/mobile accessibility decision guide: WCAG 2.2 AA, ARIA, keyboard nav, focus management, contrast, testing. Use for: a11y, accessibility, wcag, aria, screen reader, keyboard, contrast.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SebastianLuser/claude-code-arcane32026년 10월 27일 업데이트

Generate, iterate, and scale ad creative for paid advertising across Google, Meta, LinkedIn, and X. Covers platform specs, creative frameworks, and quality validation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SebastianLuser/claude-code-arcane32026년 10월 27일 업데이트

Musica interactiva para juegos: layering vertical, re-secuenciacion horizontal, stingers, reglas de transicion con sync points, y mapeo de estados de gameplay a musica. Usar para: musica adaptativa, sistema de musica dinamica, transiciones musicales, combat music.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SebastianLuser/claude-code-arcane32026년 10월 27일 업데이트

Design multi-agent systems, create agent architectures, define communication patterns, and build autonomous agent workflows with structured evaluation frameworks.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SebastianLuser/claude-code-arcane32026년 10월 27일 업데이트

Inter-agent communication protocol for C-suite agent teams. Defines invocation syntax, loop prevention, isolation rules, response formats, and quality loops.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

SebastianLuser/claude-code-arcane32026년 10월 27일 업데이트

SebastianLuser의 스킬 모두 보기

이 스킬의 문제 신고