authentication-skill
Implements authentication and authorisation systems including JWT, OAuth2, sessions, MFA, social login, RBAC, and refresh token rotation.
Skill by The13thNode
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/the13thnode-authentication-skill
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
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-skill
What's inside
- Skill name
authentication-skill- Description
- Implements authentication and authorisation systems including JWT, OAuth2, sessions, MFA, social login, RBAC, and refresh token rotation. Use when building any login/signup system, adding social auth, implementing role-based access, or designing permission systems. Trigger for "authentication", "login system", "JWT", "OAuth", "social login", "Google login", "RBAC", "permissions", "MFA", or "session management". Part of the Founder OS engineering suite.
- License
- MIT
- Instructions
- 212 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Authentication — Founder OS
## Framework 1: Auth Strategy Selection
| Method | Best For | Complexity | Use When |
|--------|---------|-----------|---------|
| JWT (stateless) | APIs, SPAs, mobile | Medium | Microservices, need to verify without DB lookup |
| Session (stateful) | Traditional web apps | Low | Simpler to revoke, server-side rendering |
| OAuth2 (social) | User acquisition | Medium | Want Google/GitHub login, reduce friction |
| Magic link | Low-friction onboarding | Low | No password friction, B2C products |
| Passkeys (WebAuthn) | Modern, passwordless | High | Future-proofing, security-focused products |
**Recommendation for most SaaS founders:** Start with a managed auth provider (Clerk, Auth0, Supabase Auth, NextAuth). Don't build auth from scratch — it's a security liability.
---
## Framework 2: JWT Implementation
### JWT Structure
```
Header.Payload.Signature
Header: { "alg": "HS256", "typ": "JWT" }
Payload: {
"sub": "user_123", // Subject (user ID)
"iat": 1704067200, // Issued at (Unix timestamp)
"exp": 1704153600, // Expiry (Unix timestamp)
"jti": "unique_token_id", // JWT ID (for revocation)
"role": "admin", // Custom claims
"orgId": "org_456" // Custom claims
}
```
### Token Rotation Pattern
```typescript
// Access token: short-lived (15 minutes)
// Refresh token: long-lived (7-30 days), stored in httpOnly cookie
// On login
const accessToken = jwt.sign(
{ sub: user.id, role: user.role, orgId: user.orgId },
process.env.JWT_SECRET,
{ expiresIn: '15m' }
);
const refreshToken = crypto.randomBytes(32).toString('hex');
await db.refreshToken.create({
data: {
token: hashToken(refreshToken), // Hash before storing
userId: user.id,
expiresAt: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000)
}
});
// Set refresh token as httpOnly cookie (not accessible to JS)
res.cookie('refresh_token', refreshToken, {
httpOnly: true,
secure: true, // HTTPS only
sameSite: 'strict',
maxAge: 30 * 24 * 60 * 60 * 1000
});
// On refresh
// 1. Validate refresh token from cookie
// 2. Delete old refresh token (rotation)
// 3. Issue new access token + new refresh token
// 4. Set new refresh token cookie
```
### Auth Middleware
```typescript
export async function requireAuth(req: Request, res: Response, next: NextFunction) {
const token = req.headers.authorization?.replace('Bearer ', '');
if (!token) {
return res.status(401).json({
success: false,
error: { code: 'UNAUTHORIZED', message: 'Authentication required' }
});
}
try {
const payload = jwt.verify(token, process.env.JWT_SECRET!) as JWTPayload;
req.user = { id: payload.sub, role: payload.role, orgId: payload.orgId };
next();
} catch {
return res.status(401).json({
success: false,
error: { code: 'TOKEN_INVALID', message: 'Token is invalid or expired' }
});
}
}
```
---
## Framework 3: OAuth2 / Social Login
### OAuth2 Flow (Google example)
```
1. User clicks "Sign in with Google"
2. Redirect to Google: GET /oauth2/auth?client_id=...&redirect_uri=...&scope=email+profile
3. User authenticates with Google
4. Google redirects back: GET /auth/callback?code=xyz123
5. Exchange code for tokens: POST /oauth2/token
6. Get user info: GET /userinfo (with access_token)
7. Create/find user in your DB, issue your own session/JWT
```
### State Parameter (CSRF protection — required)
```typescript
// Before redirecting to OAuth provider
const state = crypto.randomBytes(16).toString('hex');
req.session.oauthState = state;
const authUrl = new URL('https://accounts.google.com/o/oauth2/v2/auth');
authUrl.searchParams.set('state', state); // Include state
// On callbackFrom The13thNode/VibeCorp_PromptCEO, MIT.
More from The13thNode/VibeCorp_PromptCEO
- 0.454score
jira
The13thNode
Manages JIRA issues, projects, and workflows using Atlassian MCP.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
content-trust
The13thNode
Diagnoses why content isn't converting and fixes it using the Trust Architecture framework.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
corporate-structure
The13thNode
Prepares founders for all corporate structure and governance questions from investors.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
api-design
The13thNode
Designs REST APIs, GraphQL schemas, OpenAPI specs, webhook systems, and API versioning strategies.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
ceo-thinking-partner
The13thNode
The CEO's private brainstorming room and strategic sparring partner.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
database-design
The13thNode
Designs database schemas, migration strategies, indexing, query optimization, and ORM patterns.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
change-management
The13thNode
Manages scope changes, strategic pivots, incident communication, and team alignment when direction changes.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
ai-systems
The13thNode
Builds production-grade Claude Projects and CustomGPTs, improves AI output quality using meta-thinking prompts, and architects self-improving AI systems.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
bootstrapped-saas
The13thNode
Playbook for bootstrapped and early-stage SaaS founders based on proven case studies ($0 to $5M ARR with 6 people, and creator-to-business flywheel models).
SkillDFreshness: D★ 3Claude Code +9 - 0.446score
design-html
The13thNode
Generates production-quality HTML/React components with proper text layout, responsive reflow, and content-driven heights.
SkillDFreshness: D★ 3Claude Code +9 - 0.446score
benchmark
The13thNode
Performance baseline measurement.
SkillDFreshness: D★ 3Claude Code +9 - 0.446score
autoplan
The13thNode
One-command review pipeline.
SkillDFreshness: D★ 3Claude Code +9
Signals
- Stars
- 3
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Mar 26, 2026 (7 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from The13thNode
- 0.454score
jira
The13thNode
Manages JIRA issues, projects, and workflows using Atlassian MCP.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
ceo-thinking-partner
The13thNode
The CEO's private brainstorming room and strategic sparring partner.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
bootstrapped-saas
The13thNode
Playbook for bootstrapped and early-stage SaaS founders based on proven case studies ($0 to $5M ARR with 6 people, and creator-to-business flywheel models).
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
api-design
The13thNode
Designs REST APIs, GraphQL schemas, OpenAPI specs, webhook systems, and API versioning strategies.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
ai-systems
The13thNode
Builds production-grade Claude Projects and CustomGPTs, improves AI output quality using meta-thinking prompts, and architects self-improving AI systems.
SkillDFreshness: D★ 3Claude Code +9 - 0.449score
change-management
The13thNode
Manages scope changes, strategic pivots, incident communication, and team alignment when direction changes.
SkillDFreshness: D★ 3Claude Code +9
Cite this page
authentication-skill. Agent Mart. https://agentmart.dev/skills/the13thnode-authentication-skill (last updated 2026-10-24)