/skills-developer:authenticationfrom Developer Skills
Implement OAuth 2.0, OIDC, sessions, token lifetimes, MFA and password storage without rolling your own crypto. Use when implementing auth flows, OAuth, JWT, MFA, or sessions.
Ships in Developer Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Authentication is security engineering, not a weekend feature to hack together. Rolling custom cryptographic functions or hashing passwords with naive SHA-256 is an immediate vulnerability. Production authentication requires industry-standard protocols (OAuth 2.0, OIDC, WebAuthn), cryptographically secure password hashing (Argon2id), stateful session management or rotated short-lived JWTs, and multi-factor authentication (MFA) with replay attack protection.
crypto.randomBytes(16)).HttpOnly; Secure; SameSite=Lax cookie. Back with Redis/PostgreSQL for instant revocation.code_verifier and compute code_challenge = BASE64URL-ENCODE(SHA256(code_verifier)).state parameter on callback to prevent Cross-Site Request Forgery (CSRF).AUTH-SPEC.md)# Authentication System Specification: [Application Name]
## 1. Credentials & Cryptography Baseline
- **Password Hash**: Argon2id ($m=65536, t=3, p=4$, salt=16 bytes)
- **Session Mechanism**: Stateful HttpOnly Cookies / Ephemeral JWT
- **JWT Signing Algorithm**: RS256 (Public/Private keypair via KMS)
- **Token Lifetimes**: Access Token = 15 mins | Refresh Token = 14 days
## 2. Token Exchange & Rotation Sequence
```mermaid
sequenceDiagram
Client->>AuthServer: POST /auth/refresh (RefreshToken_v1)
alt Valid Token
AuthServer->>AuthServer: Invalidate RefreshToken_v1
AuthServer->>AuthServer: Generate RefreshToken_v2
AuthServer-->>Client: 200 OK (AccessToken_v2, RefreshToken_v2)
else Replayed Token Detected
AuthServer->>AuthServer: REVOKE ALL TOKENS FOR USER
AuthServer-->>Client: 401 Unauthorized (Breach Flagged)
end
Set-Cookie: __Host-session_id=s%3A8f...; Path=/; Secure; HttpOnly; SameSite=Lax; Max-Age=1209600
---
## Worked Example: Zero-Downtime Session Invalidation
- **Challenge**: User reported stolen laptop; needed immediate revocation across all active sessions while keeping other team members logged in.
- **Implementation**: Redis-backed session store keyed by `user_sessions:{user_id}:{session_id}`. Revoked all keys matching prefix on password reset.
- **Result**: Immediate revocation of active sessions within 5ms globally; zero orphaned tokens.
---
## Verification Checklist
- [ ] Passwords hashed using Argon2id with recommended memory and time parameters.
- [ ] Cookies configure `HttpOnly`, `Secure`, and `SameSite` flags.
- [ ] Refresh tokens use rotation and detect reuse to trigger family revocation.
- [ ] OAuth 2.0 flows implement PKCE and validate the `state` parameter against CSRF.
- [ ] Rate-limiting is enforced on all login, reset, and token endpoints (max 5 attempts/min).
---
## Anti-Patterns
- **Rolling Your Own Crypto**: Writing custom encryption or hashing algorithms.
- **Storing JWTs in LocalStorage**: Exposing tokens to XSS script injection attacks.
- **Permanent Access Tokens**: Issuing JWTs with 30-day expiration and zero revocation mechanism.
What SKILL.md sets; muted values are Claude Code's defaults
skills-developer@skillary is listed by poorvith-mp/skillary — review the source before installing
npx claudepluginhub poorvith-mp/skillary --plugin skills-developer135 skills in this plugin
/accessibility-engineerMoved to accessibility-fix in skills-developer. Removed in v4.1./accessibility-fixAudit and refactor code for WCAG 2.1/2.2 AA and AAA: ARIA, keyboard operability, screen readers. Use when auditing or remediating WCAG 2.1/2.2 AA/AAA accessibility issues./ai-data-remediation-engineerMoved to data-pipelines in skills-developer. Removed in v4.1./ai-engineerMoved to ml-deployment in skills-developer. Removed in v4.1.