auth-implementation-patterns
안전한 인증 패턴 구현하기
안전한 인증 및 권한 부여에 대한 명확한 안내가 필요하신가요? 이 스킬은 JWT, OAuth2, 세션 관리에 대해 바로 적용할 수 있는 검증된 패턴과 예제를 제공합니다.
Télécharger le ZIP du skill
Importer dans Claude
Allez dans Paramètres → Capacités → Skills → Importer un skill
Activez et commencez à utiliser
Tester
Utilisation de "auth-implementation-patterns". REST API를 위한 리프레시 토큰을 사용하는 안전한 JWT 인증 흐름을 설계하세요.
Résultat attendu:
- 데이터베이스에 해시되어 저장된 수명이 짧은 액세스 토큰과 수명이 긴 리프레시 토큰 사용
- 각 루테이션에서 리프레시 토큰을 확인하고 로그아웃 시 취소
- 검증 후 요청에 사용자 클레임 첨부
- 만료되거나 잘못된 토큰에 대해 명확한 오류 메시지와 함께 401 반환
Utilisation de "auth-implementation-patterns". Express 앱에 Google OAuth2 로그인을 어떻게 추가하나요?
Résultat attendu:
- 환경 변수의 클라이언트 ID와 시크릿을 사용하여 Passport Google Strategy 구성
- OAuth 리다이렉트를 처리하고 JWT 토큰을 생성하도록 콜백 URL 설정
- Google ID로 사용자를 찾거나 없으면 새 사용자 생성
- 액세스 토큰을 첨부하여 프론트엔드로 리다이렉트
Audit de sécurité
SûrPure documentation skill containing authentication code examples. All code is illustrative TypeScript demonstrating secure patterns (bcrypt with 12 rounds, JWT, proper cookie flags). No executable code, shell commands, network calls, or file system access beyond reading its own files. Static findings are false positives triggered by markdown code block backticks, environment variable references in examples, and security library mentions. The previous audit correctly identified this as safe.
Facteurs de risque
🌐 Accès réseau (1)
⚙️ Commandes externes (18)
🔑 Variables d’environnement (23)
Score de qualité
Ce que vous pouvez construire
API 보안 설정
적절한 미들웨어와 토큰 처리를 통해 JWT 또는 세션 인증을 선택하고 구현하세요.
소셜 로그인 추가
OAuth2 흐름과 리다이렉트 처리를 명확한 예제와 함께 통합하세요.
인증 설계 감사
일반적인 함정과 비교하여 역할 및 권한 적용 패턴을 확인하세요.
Essayez ces prompts
소규모 SaaS 앱에 대해 세션 또는 JWT 인증을 추천하세요. 트레이드오프와 권장 기본값을 포함하세요.
Node API를 위한 안전한 리프레시 토큰 흐름과 저장 안내를 제공하세요.
사용자, Moderator, 관리자를 위한 RBAC 미들웨어와 역할 계층 구조를 설계하세요.
속도 제한 및 비밀번호 정책을 포함한 로그인을 보호하기 위한 구체적인 단계를 나열하세요.
Bonnes pratiques
- 액세스 토큰은 수명을 짧게 유지하고 안전한 저장소로 리프레시 토큰을 순환하세요
- bcrypt 또는 argon2 해싱으로 강력한 비밀번호 정책 적용
- 무차별 대입 공격을 방지하기 위해 인증 엔드포인트에 속도 제한 적용
Éviter
- XSS 보호 없이 JWT를 localStorage에 저장
- 토큰 만료나 리프레시 토큰 순환 건너뛰기
- 서버 검증 없이 클라이언트 측에서만 요청 승인