auth-implementation-patterns
Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems.
Skill by viniciuscs84
Chalk Labs
Need help deploying auth-implementation-patterns?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
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/viniciuscs84-auth-implementation-patterns
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: not checked yet.
What's inside
- Skill name
auth-implementation-patterns- Description
- Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems. Use when implementing auth systems, securing APIs, or debugging security issues.
- License
- MIT
- Instructions
- 635 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- body: 635 lines (spec recommends under 500)
Files (1)
- SKILL.md
SKILL.md (first lines)
# Authentication & Authorization Implementation Patterns
Build secure, scalable authentication and authorization systems using industry-standard patterns and modern best practices.
## When to Use This Skill
- Implementing user authentication systems
- Securing REST or GraphQL APIs
- Adding OAuth2/social login
- Implementing role-based access control (RBAC)
- Designing session management
- Migrating authentication systems
- Debugging auth issues
- Implementing SSO or multi-tenancy
## Core Concepts
### 1. Authentication vs Authorization
**Authentication (AuthN)**: Who are you?
- Verifying identity (username/password, OAuth, biometrics)
- Issuing credentials (sessions, tokens)
- Managing login/logout
**Authorization (AuthZ)**: What can you do?
- Permission checking
- Role-based access control (RBAC)
- Resource ownership validation
- Policy enforcement
### 2. Authentication Strategies
**Session-Based:**
- Server stores session state
- Session ID in cookie
- Traditional, simple, stateful
**Token-Based (JWT):**
- Stateless, self-contained
- Scales horizontally
- Can store claims
**OAuth2/OpenID Connect:**
- Delegate authentication
- Social login (Google, GitHub)
- Enterprise SSO
## JWT Authentication
### Pattern 1: JWT Implementation
```typescript
// JWT structure: header.payload.signature
import jwt from "jsonwebtoken";
import { Request, Response, NextFunction } from "express";
interface JWTPayload {
userId: string;
email: string;
role: string;
iat: number;
exp: number;
}
// Generate JWT
function generateTokens(userId: string, email: string, role: string) {
const accessToken = jwt.sign(
{ userId, email, role },
process.env.JWT_SECRET!,
{ expiresIn: "15m" }, // Short-lived
);
const refreshToken = jwt.sign(
{ userId },
process.env.JWT_REFRESH_SECRET!,
{ expiresIn: "7d" }, // Long-lived
);
return { accessToken, refreshToken };
}
// Verify JWT
function verifyToken(token: string): JWTPayload {
try {
return jwt.verify(token, process.env.JWT_SECRET!) as JWTPayload;
} catch (error) {
if (error instanceof jwt.TokenExpiredError) {
throw new Error("Token expired");
}
if (error instanceof jwt.JsonWebTokenError) {
throw new Error("Invalid token");
}
throw error;
}
}
// Middleware
function authenticate(req: Request, res: Response, next: NextFunction) {
const authHeader = req.headers.authorization;
if (!authHeader?.startsWith("Bearer ")) {
return res.status(401).json({ error: "No token provided" });
}
const token = authHeader.substring(7);
try {
const payload = verifyToken(token);
req.user = payload; // Attach user to request
next();
} catch (error) {
return res.status(401).json({ error: "Invalid token" });
}
}
// UsageFrom viniciuscs84/sdd-toolkit, MIT.
More from viniciuscs84/sdd-toolkit
- 0.479score
csharp-xml-docs
viniciuscs84
C# XML documentation with on-demand Haiku→Expert Review→Final workflow.
SkillCFreshness: CClaude Code +9 - 0.476score
agent-browser
viniciuscs84
Use for automated browser tasks (navigation, form filling, scraping, screenshots, web app testing).
SkillCFreshness: CClaude Code +9 - 0.474score
cpp-development
viniciuscs84
Use when writing, reviewing, or refactoring C++ code — covers workflow, essential patterns, and pre-commit checklist for modern C++17/20.
SkillCFreshness: CClaude Code +9 - 0.474score
audio-dsp
viniciuscs84
Use when implementing real-time DSP algorithms, audio thread architecture, or offline spectral analysis in C++/Rust.
SkillCFreshness: CClaude Code +9 - 0.473score
agents-md
viniciuscs84
Use when asked to write or review AGENTS.md/CLAUDE.md/LLMs.md context files.
SkillCFreshness: CClaude Code +9 - 0.473score
cpp-testing
viniciuscs84
Use when writing or fixing C++ tests, configuring GoogleTest/CTest, or adding coverage/sanitizers.
SkillCFreshness: CClaude Code +9 - 0.473score
code-review-excellence
viniciuscs84
Use when conducting code reviews or establishing review standards.
SkillCFreshness: CClaude Code +9 - 0.471score
audio-engineering-principles
viniciuscs84
Use for real-time audio code safety, determinism, and numeric hygiene.
SkillCFreshness: CClaude Code +9 - 0.470score
csharp-refactor
viniciuscs84
C# code refactoring skill.
SkillCFreshness: CClaude Code +9 - 0.469score
csharp-docs
viniciuscs84
Ensure that C# types are documented with XML comments and follow best practices for documentation.
SkillCFreshness: CClaude Code +9 - 0.469score
csharp-mstest
viniciuscs84
Get best practices for MSTest 3.x/4.x unit testing, including modern assertion APIs and data-driven tests
SkillCFreshness: CClaude Code +9 - 0.468score
csharp-code-review
viniciuscs84
C# code review skill.
SkillCFreshness: CClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- May 30, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/viniciuscs84/sdd-toolkit
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.449score
auth-implementation-patterns
agent-skills-hub
Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems.
SkillDFreshness: D★ 123Claude Code +9 - 0.341score
auth-implementation-patterns
Narendarcodes
Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems.
SkillBFreshness: B★ 4Claude Code +9 - 0.297score
auth-implementation-patterns
ovachiever
Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems.
SkillDFreshness: D★ 55Claude Code +9 - 0.290score
auth-implementation-patterns
roadsidedev
Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems.
SkillDFreshness: D★ 20Claude Code +9 - 0.288score
auth-implementation-patterns
Mr-Wolv
Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems.
SkillCFreshness: CClaude Code +9 - 0.283score
auth-implementation-patterns
scaleto
Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems.
SkillDFreshness: D★ 8Claude Code +9 - 0.279score
auth-implementation-patterns
haresh-sai06
Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems.
SkillCFreshness: CClaude Code +9 - 0.237score
auth-implementation-patterns
aiagentskills
Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems.
SkillDFreshness: DClaude Code +9 - 0.237score
auth-implementation-patterns
abdellaziz-ali
Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems.
SkillDFreshness: DClaude Code +9
More from viniciuscs84
- 0.479score
csharp-xml-docs
viniciuscs84
C# XML documentation with on-demand Haiku→Expert Review→Final workflow.
SkillCFreshness: CClaude Code +9 - 0.476score
agent-browser
viniciuscs84
Use for automated browser tasks (navigation, form filling, scraping, screenshots, web app testing).
SkillCFreshness: CClaude Code +9 - 0.474score
audio-dsp
viniciuscs84
Use when implementing real-time DSP algorithms, audio thread architecture, or offline spectral analysis in C++/Rust.
SkillCFreshness: CClaude Code +9 - 0.474score
cpp-development
viniciuscs84
Use when writing, reviewing, or refactoring C++ code — covers workflow, essential patterns, and pre-commit checklist for modern C++17/20.
SkillCFreshness: CClaude Code +9 - 0.473score
code-review-excellence
viniciuscs84
Use when conducting code reviews or establishing review standards.
SkillCFreshness: CClaude Code +9 - 0.473score
cpp-testing
viniciuscs84
Use when writing or fixing C++ tests, configuring GoogleTest/CTest, or adding coverage/sanitizers.
SkillCFreshness: CClaude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get auth-implementation-patterns running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
auth-implementation-patterns skill. Agent Mart. https://agentmart.dev/skills/viniciuscs84-auth-implementation-patterns (last updated 2026-10-24)