auth-implementation-patterns

auth-implementation-patterns is a skill for Claude Code, Codex from frontal-labs/mcp-server. It costs 46 tokens per session (594 once invoked), scanned A, a copy of auth-implementation-patterns, Apache-2.0.

A guide to implementing login and permission systems, including passwords, OAuth2, JWTs, sessions, and role-based access control. Authentication checks who a user is; authorization checks what that user may do.

In plain words
What is it for?
Use it when building login, logout, sessions, social sign-in, single sign-on, API protection, user roles, or multi-tenant access rules.
Why use it?
It helps avoid common mistakes when securing applications and APIs, such as confusing identity checks with permission checks. It provides patterns for adding or changing access control and diagnosing authentication problems.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when building login, logout, sessions, social sign-in, single sign-on, API protection, user roles, or multi-tenant access rules.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/frontal-labs/mcp-server/auth-implementation-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add frontal-labs/mcp-server --skill auth-implementation-patterns
Clone the repo
git clone --depth 1 https://github.com/frontal-labs/mcp-server

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for auth-implementation-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/frontal-labs/mcp-server/auth-implementation-patterns/github.svg)](https://agentmods.dev/skills/frontal-labs/mcp-server/auth-implementation-patterns)
Your own site
<a href="https://agentmods.dev/skills/frontal-labs/mcp-server/auth-implementation-patterns"><img src="https://agentmods.dev/badge/skills/frontal-labs/mcp-server/auth-implementation-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for auth-implementation-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/frontal-labs/mcp-server/auth-implementation-patterns"><img src="https://agentmods.dev/badge/skills/frontal-labs/mcp-server/auth-implementation-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 594 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00046 $0.00594
Opus 5.5 $0.00018 $0.00238
Sonnet 5.5 $0.00009 $0.00119
Haiku 4.5 $0.00005 $0.00059

Measured yesterday against content hash 1fc61d6074ac, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

auth-implementation-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to auth-implementation-patterns — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/auth-implementation-patterns/SKILL.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Best Practices

  1. Never Store Plain Passwords: Always hash with bcrypt/argon2
  2. Use HTTPS: Encrypt data in transit
  3. Short-Lived Access Tokens: 15-30 minutes max
  4. Secure Cookies: httpOnly, secure, sameSite flags
  5. Validate All Input: Email format, password strength
  6. Rate Limit Auth Endpoints: Prevent brute force attacks
  7. Implement CSRF Protection: For session-based auth
  8. Rotate Secrets Regularly: JWT secrets, session secrets
  9. Log Security Events: Login attempts, failed auth
  10. Use MFA When Possible: Extra security layer

Common Pitfalls

  • Weak Passwords: Enforce strong password policies
  • JWT in localStorage: Vulnerable to XSS, use httpOnly cookies
  • No Token Expiration: Tokens should expire
  • Client-Side Auth Checks Only: Always validate server-side
  • Insecure Password Reset: Use secure tokens with expiration
  • No Rate Limiting: Vulnerable to brute force
  • Trusting Client Data: Always validate on server

Read the full file on GitHub · 84 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 84 lines · 46 tokens per session scan A 1fc61d6074ac

Subscribe to this mod's changes

auth-implementation-patterns is a skill published in the GitHub repository frontal-labs/mcp-server (1 stars, last pushed yesterday), licensed Apache-2.0. It adds 46 tokens to every session and 594 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to auth-implementation-patterns, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

django-patterns

Django architecture patterns, REST API design with DRF, ORM best practices, caching, signals, middleware, and production-grade Django apps.

affaan-m/ECC · 32 tokens

fastapi-patterns

FastAPI patterns for async APIs, dependency injection, Pydantic request and response models, OpenAPI docs, tests, security, and production readiness.

affaan-m/ECC · 35 tokens

stripe-projects

Provision SaaS services + sync creds via Stripe Projects.

NousResearch/hermes-agent · 15 tokens

status

Show whether Mem0 memory is working in this repository, covering configuration, capture state, pending flushes, and whether the Mem0 API key is valid. Use when the user asks whether memory is on, why a memory is missing, or anything looks broken.

mem0ai/mem0 · 54 tokens

open-source

Documentation reference for writing Python code using the browser-use open-source library. Use this skill whenever the user needs help with Agent, Browser, or Tools configuration, is writing code that imports from browseruse, asks about @sandbox deployment, supported LLM models, Actor API, custom tools, lifecycle…

browser-use/browser-use · 137 tokens

mem0-test-integration

Verify a Mem0 integration produced by /mem0-integrate. Runs in the same workspace on the same branch (loose coupling) — installs dependencies, runs the repo's native test suite, then exercises a real end-to-end smoke flow against the user's API key. Produces a scorecard. TRIGGER when: user has just run /mem0-integrate…

mem0ai/mem0 · 207 tokens