auth-flow-validation
БесплатноБез исполняемых скриптовНе проверенAuthentication flow validation between frontend and backend. Covers JWT, OAuth2, token refresh, and session management sync. USE WHEN: user asks about "auth…
от claude-dev-suite★ 51 звезда на GitHubОб этом скилле
Auth Flow Validation - Quick Reference
When NOT to Use This Skill
- Security auditing - Use
securityskills - OAuth provider configuration - Use
oauth2skill - JWT implementation - Use
jwtskill
Deep Knowledge: Use
mcp__documentation__fetch_docswith technology:jwtoroauth2for protocol details.
Auth Flow Overview
┌─────────────────────────────────────────────────────────────────────┐
│ AUTHENTICATION FLOW │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ Frontend Backend │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ 1. Login │──────────→│ POST /auth │ │
│ │ Form │ │ /login │ │
│ └──────────────┘ └──────┬───────┘ │
│ ↑ │ │
│ │ ↓ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ 2. Store │←──────────│ Return JWT │ │
│ │ Tokens │ │ + Refresh │ │
│ └──────────────┘ └──────────────┘ │
│ │ │
│ ↓ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ 3. API Call │──────────→│ Validate JWT │ │
│ │ + Auth Header│ │ │ │
│ └──────────────┘ └──────┬───────┘ │
│ ↑ │ │
│ │ 401 Unauthorized │ │
│ │←─────────────────────────┤ │
│ │ │ │
│ ↓ │ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ 4. Refresh │──────────→│ POST /auth │ │
│ │ Token │ │ /refresh │ │
│ └──────────────┘ └──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────┘
Validation Checklist
Login Flow
| Step | Frontend | Backend | Validation |
|---|---|---|---|
| Endpoint | POST /auth/login | POST /auth/login | Path match |
| Request Body | { email, password } | { email, password } | Schema match |
| Response | { accessToken, refreshToken, user } | Same structure | Type match |
| Token Storage | localStorage/httpOnly cookie | Expects cookie or header | Method match |
| Error Response | Handle 401, 400 | Returns structured error | Error format |
Token Refresh Flow
| Step | Frontend | Backend | Validation |
|---|---|---|---|
| Trigger | 401 response intercepted | Returns 401 on expired | Consistent behavior |
| Endpoint | POST /auth/refresh | POST /auth/refresh | Path match |
| Request | refreshToken in body/cookie | Expects same location | Method match |
| Response | New accessToken | Returns new token | Structure match |
| Retry | Original request retried | Accepts new token | Flow complete |
Common Discrepancies
1. Token Storage Mismatch
// Backend expects: HttpOnly cookie
res.cookie('accessToken', token, {
httpOnly: true,
secure: true,
sameSite: 'strict',
});
// Frontend stores: localStorage (MISMATCH!)
localStorage.setItem('accessToken', response.accessToken);
// Frontend should: Let backend set cookie
// No manual storage needed - cookie sent automatically
2. Authorization Header Format
// Backend expects
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
// Frontend sends (WRONG)
Authorization: eyJhbGciOiJIUzI1NiIs... // Missing "Bearer "
// Frontend sends (WRONG)
Authorization: bearer eyJhbGciOiJIUzI1NiIs... // Wrong case
// Correct frontend implementation
const token = getAccessToken();
fetch('/api/users', {
headers: {
'Authorization': `Bearer ${token}`,
},
});
3. Refresh Token Placement
// Backend expects: Cookie
app.post('/auth/refresh', (req, res) => {
const refreshToken = req.cookies.refreshToken; // From cookie
});
// Frontend sends: Body (MISMATCH!)
fetch('/auth/refresh', {
method: 'POST',
body: JSON.stringify({ refreshToken }), // Wrong!
});
// Correct: Cookie sent automatically
fetch('/auth/refresh', {
method: 'POST',
credentials: 'include', // Include cookies
Установить auth-flow-validation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobBashFAQ
Что делает скилл auth-flow-validation?
Authentication flow validation between frontend and backend. Covers JWT, OAuth2, token refresh, and session management sync. USE WHEN: user asks about "auth integration", "JWT validation", "token refresh", "401 handling", "authentication flow", "login integration" DO NOT USE FOR: security auditing - use security skills, OAuth provider setup - use authentication skills
Как установить скилл auth-flow-validation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл auth-flow-validation запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic