Backend Auth Patterns

Use when the user asks about authentication, JWT login with refresh tokens, sessions, OAuth 2.0 / OIDC login, password hashing, MFA, passwordless or refresh token rotation. Produces server-side auth flows. Not for roles and permissions (use backend-authorization) or browser login UI (use frontend-authentication).

45 stars 6 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add j4flmao/agent-skills --skill backend-auth-patterns
Manual install
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills/skills/backend/universal/auth-patterns ~/.claude/skills/backend-auth-patterns

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Backend Auth Patterns

## Purpose
Implement authentication and authorization that is secure by default. Every endpoint must have an auth check. No secrets in code. No plaintext passwords.

## Agent Protocol

### Trigger
Exact user phrases: "auth", "authentication", "authorization", "JWT", "OAuth", "RBAC", "permissions", "login", "session", "refresh token", "guard", "middleware auth", "access control", "secure endpoint".

### Input Context
- Application type (SPA, mobile, M2M, server-rendered).
- Security requirements level (basic auth, enterprise SSO, API-key M2M).
- Existing auth infrastructure (if any).

### Output Artifact
Auth design as text. No file output.

### Response Format
```
Auth strategy: {strategy name}
Rationale: {one sentence}
Token structure: {claims}
Auth middleware: {location and logic}
Authorization model: {model name and role/permission list}
```

### Completion Criteria
- [ ] Auth strategy selected based on application type
- [ ] Token structure defined with minimum viable claims
- [ ] Refresh token rotation specified
- [ ] Authorization model defined (RBAC or ABAC)
- [ ] Auth middleware placement specified (Infrastructure layer)
- [ ] Password hashing algorithm specified (bcrypt/argon2)
- [ ] Brute force protection specified
- [ ] No secrets hardcoded in any code example

## Architecture Decision Trees

### Auth Strategy Selection
Read the full skill on GitHub

Details

Skill name
backend-auth-patterns
Path
skills/backend/universal/auth-patterns/SKILL.md
License
MIT
Repo updated
17 November 2026

FAQ

What does the Backend Auth Patterns skill do?

Use when the user asks about authentication, JWT login with refresh tokens, sessions, OAuth 2.0 / OIDC login, password hashing, MFA, passwordless or refresh token rotation. Produces server-side auth flows. Not for roles and permissions (use backend-authorization) or browser login UI (use frontend-authentication).

How do I install the Backend Auth Patterns skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add j4flmao/agent-skills --skill backend-auth-patterns. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Backend Auth Patterns popular?

It lives in j4flmao/agent-skills, which has 45 GitHub stars and 6 forks.

Related skills

Agent Observability

45

j4flmao/agent-skills

Use when the user asks about agent observability, tracing agent reasoning, debugging an agent loop, OpenTelemetry GenAI spans for LLM calls, LLM cost tracking per agent, agent audit logs or hallucination/eval monitoring in production. Produces instrumentation config, trace schema, dashboards, alerts and cost attribution. Not for generic service tracing without LLMs (use devops-opentelemetry).

DevOps & Cloud

AI Agent Architectures

45

j4flmao/agent-skills

Use when the user asks to build an AI agent, design an agent that calls tools and keeps memory, write an agent system prompt or pick an agent framework (Claude Agent SDK, OpenAI Agents SDK, LangGraph). Produces an architecture brief covering loop, tools, memory, guardrails and evals, routing depth to child skills. Not for workflow patterns (use ai-agentic-workflows).

AI, LLMs & Agents

AI Agent Core Loop

45

j4flmao/agent-skills

Use when the user asks about the agent loop, ReAct vs plan-and-solve, re-planning, Reflexion, an agent stuck in a loop, max iterations or termination conditions. Produces a loop spec or patch with state, success predicate, caps and no-progress detection. Not for overall agent design (use ai-agent-architectures) or tool schemas (use tool-calling-principles).

AI, LLMs & Agents

Backend Authorization

45

j4flmao/agent-skills

Use when the user asks about authorization, role based permissions for admins, editors and viewers, RBAC, ABAC, ReBAC, Casbin, Cerbos, OpenFGA, break-glass or JIT elevation. Produces a server-side permission model with enforcement code. Not for login and tokens (use backend-auth-patterns).

Software Development

Backend Audit Logging

45

j4flmao/agent-skills

Use when the user asks about audit logs, audit trail, who changed what, tamper-evident or append-only logs, hash chains, SOC 2 audit evidence or change tracking tables. Produces an immutable audit trail design and code. Not for application logs (use backend-structured-logging).

Software Development

Backend Background Jobs

45

j4flmao/agent-skills

Use when the user asks about background jobs, processing uploads in a background worker with retries, task queues, BullMQ, Sidekiq, Celery, dead letter queues or worker concurrency. Produces idempotent job workers with retry policy. Not for cron schedules (use backend-scheduling-cron) or broker design (use backend-message-queue).

Software Development

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.