Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
yonatangross avatar

Auth Patterns

  • 19 installs
  • 213 repo stars
  • Updated August 4, 2026
  • yonatangross/orchestkit

Helps with ai & agent building tasks.

About

auth-patterns is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.

  • auth-patterns
  • AI & Agent Building
  • AI-coding skill

Auth Patterns by the numbers

  • 19 all-time installs (skills.sh)
  • Ranked #10,587 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/yonatangross/orchestkit --skill auth-patterns

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs19
repo stars213
Last updatedAugust 4, 2026
Repositoryyonatangross/orchestkit

What it does

Helps with ai & agent building tasks.

Files

SKILL.mdMarkdownGitHub ↗

Authentication Patterns

Implement secure authentication with OAuth 2.1, Passkeys, and modern security standards.

Overview

  • Login/signup flows
  • JWT token management
  • Session security
  • OAuth 2.1 with PKCE
  • Passkeys/WebAuthn
  • Multi-factor authentication
  • Role-based access control

Quick Reference

Password Hashing (Argon2id)

from argon2 import PasswordHasher
ph = PasswordHasher()
password_hash = ph.hash(password)
ph.verify(password_hash, password)

JWT Access Token

import jwt
from datetime import datetime, timedelta, timezone
payload = {
    'user_id': user_id,
    'type': 'access',
    'exp': datetime.now(timezone.utc) + timedelta(minutes=15),
}
token = jwt.encode(payload, SECRET_KEY, algorithm='HS256')

OAuth 2.1 with PKCE (Required)

import hashlib, base64, secrets
code_verifier = secrets.token_urlsafe(64)
digest = hashlib.sha256(code_verifier.encode()).digest()
code_challenge = base64.urlsafe_b64encode(digest).rstrip(b'=').decode()

Session Security

app.config['SESSION_COOKIE_SECURE'] = True      # HTTPS only
app.config['SESSION_COOKIE_HTTPONLY'] = True    # No JS access
app.config['SESSION_COOKIE_SAMESITE'] = 'Strict'

Token Expiry ( Guidelines)

Token TypeExpiryStorage
Access15 min - 1 hourMemory only
Refresh7-30 daysHTTPOnly cookie

Anti-Patterns (FORBIDDEN)

# ❌ NEVER store passwords in plaintext
user.password = request.form['password']

# ❌ NEVER use implicit OAuth grant
response_type=token  # Deprecated in OAuth 2.1

# ❌ NEVER skip rate limiting on login
@app.route('/login')  # No rate limit!

# ❌ NEVER reveal if email exists
return "Email not found"  # Information disclosure

# ✅ ALWAYS use Argon2id or bcrypt
password_hash = ph.hash(password)

# ✅ ALWAYS use PKCE
code_challenge=challenge&code_challenge_method=S256

# ✅ ALWAYS rate limit auth endpoints
@limiter.limit("5 per minute")

# ✅ ALWAYS use generic error messages
return "Invalid credentials"

Key Decisions

DecisionRecommendation
Password hashArgon2id > bcrypt
Access token expiry15 min - 1 hour
Refresh token expiry7-30 days with rotation
Session cookieHTTPOnly, Secure, SameSite=Strict
Rate limit5 attempts per minute
MFAPasskeys > TOTP > SMS
OAuth2.1 with PKCE (no implicit)

Detailed Documentation

ResourceDescription
references/oauth-2.1-passkeys.mdOAuth 2.1, PKCE, Passkeys/WebAuthn
examples/auth-implementations.mdComplete implementation examples
checklists/auth-checklist.mdSecurity checklist
scripts/auth-middleware-template.pyFlask/FastAPI middleware

Related Skills

  • owasp-top-10 - Security fundamentals
  • input-validation - Data validation
  • api-design-framework - API security

Capability Details

password-hashing

Keywords: password, hashing, bcrypt, argon2, hash Solves:

  • Securely hash passwords with modern algorithms
  • Configure appropriate cost factors
  • Migrate legacy password hashes

jwt-tokens

Keywords: JWT, token, access token, claims, jsonwebtoken Solves:

  • Generate and validate JWT access tokens
  • Implement proper token expiration
  • Handle token refresh securely

oauth2-pkce

Keywords: OAuth, PKCE, OAuth 2.1, authorization code, code verifier Solves:

  • Implement OAuth 2.1 with PKCE flow
  • Secure authorization for SPAs and mobile apps
  • Handle OAuth provider integration

passkeys-webauthn

Keywords: passkey, WebAuthn, FIDO2, passwordless, biometric Solves:

  • Implement passwordless authentication
  • Configure WebAuthn registration and login
  • Support cross-device passkeys

session-management

Keywords: session, cookie, session storage, logout, invalidate Solves:

  • Manage user sessions securely
  • Implement session invalidation on logout
  • Handle concurrent sessions

role-based-access

Keywords: RBAC, role, permission, authorization, access control Solves:

  • Implement role-based access control
  • Define permission hierarchies
  • Check authorization in routes

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.