authentication
Implement OAuth 2.0, OIDC, sessions, token lifetimes, MFA and password storage without rolling your own crypto.
Skill by poorvith-mp
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/poorvith-mp-authentication
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: security, finance
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/authentication
What's inside
- Skill name
authentication- Description
- 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.
- License
- MIT
- Instructions
- 104 lines in SKILL.md · view on GitHub
Files (3)
- SKILL.md
- authentication.skill
- routing.yaml · evals/
SKILL.md (first lines)
# authentication
## Core Philosophy
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.
---
## 4-Step Authentication Architecture Framework
### Step 1: Password Storage & Cryptographic Hashing
1. **The Argon2id Standard**:
- Never use MD5, SHA-1, SHA-256, or plain bcrypt for new systems. Enforce **Argon2id** (RFC 9106):
- Memory Cost ($m$): minimum 64MB (65536 KiB).
- Time Cost ($t$): minimum 3 iterations.
- Parallelism ($p$): 4 threads.
- Salt: 16 cryptographically secure random bytes generated per password (`crypto.randomBytes(16)`).
2. **Password Policies**:
- Enforce minimum length (>= 12 characters). Prohibit arbitrary character restrictions that prevent password managers from generating high-entropy strings.
- Screen passwords against haveibeenpwned k-anonymity hash API during registration.
### Step 2: Session Management & Token Lifecycles
1. **Cookie-Based Sessions vs Stateless JWTs**:
- *Stateful Sessions (Preferred for Web Apps)*: Store session ID in an `HttpOnly; Secure; SameSite=Lax` cookie. Back with Redis/PostgreSQL for instant revocation.
- *Stateless JWTs (API / Mobile)*:
- Access Token TTL: Strictly 10 to 15 minutes. Sign with asymmetric keys (RS256 or Ed25519), never symmetric HS256 with weak secrets.
- Refresh Token TTL: 14 to 30 days. Store hashed in database.
2. **Refresh Token Rotation & Reuse Detection**:
- Issue a single-use refresh token. When exchanged, issue a new access token and invalidate the old refresh token.
- If an invalidated refresh token is ever presented, invalidate the entire token family immediately—this indicates token theft.
### Step 3: OAuth 2.0 & OpenID Connect (OIDC) with PKCE
1. **Authorization Code Flow with PKCE**:
- Proof Key for Code Exchange (PKCE, RFC 7636) is mandatory for all clients (SPAs, mobile apps, and server-side apps).
- Generate high-entropy `code_verifier` and compute `code_challenge = BASE64URL-ENCODE(SHA256(code_verifier))`.
- Validate cryptographically random `state` parameter on callback to prevent Cross-Site Request Forgery (CSRF).
### Step 4: Multi-Factor Authentication (MFA) & Passkeys
1. **TOTP (RFC 6238)**:
- Secret key minimum 160 bits (32 base32 characters).
- Time step: 30 seconds; clock skew allowance: $\pm 1$ step.
- Generate 8 single-use emergency backup recovery codes, hashed with Argon2id.
2. **WebAuthn / Passkeys (FIDO2)**:
- Implement biometric passkeys as primary or secondary auth, binding authentication to the physical hardware authenticator and origin domain.
---
## Deliverable Format: Authentication Architecture Spec (`AUTH-SPEC.md`)
```markdown
# 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
```
## 3. Cookie Security Attributes
```http
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.From poorvith-mp/skills-developer, MIT.
More from poorvith-mp/skills-developer
- 0.456score
api-design
poorvith-mp
Design and document REST, GraphQL and gRPC contracts with OpenAPI, versioning and contract tests.
SkillAFreshness: AClaude Code +9 - 0.456score
accessibility-fix
poorvith-mp
Audit and refactor code for WCAG 2.1/2.2 AA and AAA: ARIA, keyboard operability, screen readers.
SkillAFreshness: AClaude Code +9 - 0.452score
change-notes
poorvith-mp
Write commit messages, PR descriptions and changelog entries from the diff itself.
SkillAFreshness: AClaude Code +9 - 0.452score
branching-strategy
poorvith-mp
Design the branching and release model: trunk-based or GitFlow, protection rules, review policy, tracker traceability.
SkillAFreshness: AClaude Code +9 - 0.452score
backend-build
poorvith-mp
Implement services and business logic: request handling, validation, transactions, caching, queues and workers.
SkillAFreshness: AClaude Code +9 - 0.452score
audit-readiness
poorvith-mp
Prepare for SOC 2, ISO 27001, HIPAA or PCI-DSS: control mapping, gap analysis and evidence.
SkillAFreshness: AClaude Code +9 - 0.427score
accessibility-engineer
poorvith-mp
Moved to accessibility-fix in skills-developer.
SkillAFreshness: AClaude Code +9 - 0.427score
appsec-architect
poorvith-mp
Moved to security-review in skills-developer.
SkillAFreshness: AClaude Code +9 - 0.424score
ci-cd-pipeline-builder
poorvith-mp
Moved to ci-pipelines in skills-developer.
SkillAFreshness: AClaude Code +9 - 0.424score
android-developer
poorvith-mp
Moved to mobile-build in skills-developer.
SkillAFreshness: AClaude Code +9 - 0.424score
api-lifecycle-engineer
poorvith-mp
Moved to api-design in skills-developer.
SkillAFreshness: AClaude Code +9 - 0.423score
ai-data-remediation-engineer
poorvith-mp
Moved to data-pipelines in skills-developer.
SkillAFreshness: AClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Sep 12, 2026 (1 month ago)
- Last release
- Oct 2, 2026 (26 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/poorvith-mp/skills-developer
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from poorvith-mp
- 0.495score
blender-modeling
poorvith-mp
Model, retopologise, UV unwrap and bake game-ready assets with correct scale, pivots and polycount.
SkillAFreshness: A★ 5Claude Code +9 - 0.495score
game-audio
poorvith-mp
Integrate FMOD and Wwise, build adaptive music systems, spatial audio and audio performance budgets.
SkillAFreshness: A★ 5Claude Code +9 - 0.495score
anti-cheat
poorvith-mp
Enforce server authority and defend against speed hacks, memory editing, and exploits.
SkillAFreshness: A★ 5Claude Code +9 - 0.495score
blender-animation
poorvith-mp
Rig, skin and animate characters and props, and export clean animation sets to an engine.
SkillAFreshness: A★ 5Claude Code +9 - 0.495score
game-ai
poorvith-mp
Design NPC behaviour: behaviour trees, state machines, pathfinding, perception and difficulty tuning.
SkillAFreshness: A★ 5Claude Code +9 - 0.495score
game-build-pipeline
poorvith-mp
Automate platform builds, asset cooking, console certification prep, and Steam or itch.io depot publishing.
SkillAFreshness: A★ 5Claude Code +9
Cite this page
authentication skill. Agent Mart. https://agentmart.dev/skills/poorvith-mp-authentication (last updated 2026-10-24)