Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Authentication Authorization Skill

ASecurity

Implement authentication and authorization — OAuth2/OIDC, JWT, sessions, RBAC/ABAC, NextAuth/Auth.js, Passport.js, password hashing, CSRF.

6 stars
0 votes
0 copies
0 views
Added 9/20/2026
securitygonextjsfastapiapisecurity

Works with

api

Security Analysis

A100/100

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add darellchua2/opencode-config-template --skill authentication-authorization-skill --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Authentication Authorization Skill?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Authentication Authorization Skill
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/darellchua2-authentication-authorization-skill/badge)](https://www.skillsdirectory.com/skills/darellchua2-authentication-authorization-skill)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: authentication-authorization-skill
description: >-
  Implement authentication and authorization — OAuth2/OIDC, JWT, sessions,
  RBAC/ABAC, NextAuth/Auth.js, Passport.js, password hashing, CSRF.
license: Apache-2.0
compatibility: opencode
category: Security
---

## What I do

Implement authn/authz: OAuth2/OIDC flows, JWT lifecycle, sessions, RBAC/ABAC, framework integration, password hashing, CSRF. (This skill *implements*; `security-audit-skill` *audits*.)

## When to use me

Login/signup flows, OAuth social login, RBAC design, JWT management, NextAuth/Passport integration, API auth middleware, CSRF hardening, MFA.

**Related:** `security-audit-skill` (auditing/detection) · `api-design-skill` (endpoint design) · `nextjs-standard-setup-skill` (scaffolding incl. auth).

## House patterns

**two-layer-keycloak-authorization** — Keycloak defense-in-depth: Layer 1 = coarse Policy Enforcer (route-level `/admin/*` requires role, method-level DELETE scopes); Layer 2 = fine-grained app-layer composite roles (ownership `user.ownOrg === resource.orgId`, tenant scoping). Layer 2 runs EVEN IF Layer 1 passes — the Policy Enforcer cannot enforce data-level authorization.

**one-policy-per-role-type** (provenance: betekk-keycloak/LEARNINGS) — in Keycloak Authorization Services, one policy per role type (`admin-policy`, `editor-policy`, …), composed at the permission level via `ALL`/`ANY`. If a policy condition checks more than one role type, split it — collapsed policies resist audits and grant unintended access when roles change.

**stateless-cookie-cache-maxage-match-session** — with JWE cookies, `cookieCache.maxAge` MUST be `>= session.cookie.maxAge`. If the decryption cache expires first, `findSession()` returns null and silently deletes the session — users logged out mid-session with no error. The cache is an optimization and must never terminate a session.

**chunked-cookie-secure-prefix-mismatch** — always use one shared cookie utility for set/get; never hand-roll `__Secure-`/`__Host-` prefix logic per module. Browsers silently drop `__Secure-` cookies without `Secure` (or over HTTP) and `__Host-` without `Path=/`+no Domain; one module writing `__Secure-session` while another reads `session` = session loss / CSRF mismatch.

**cookie-only-proxy-with-server-rbac** — in stateless mode the middleware's ONLY job is "does a session cookie exist?" (local check). Token refresh → `customSession`/JWT callback (once per session); RBAC → per-route server layouts or resolver guards (only when that route renders). Any `await fetch` in middleware adds 50–500 ms to EVERY navigation.
Detection: `rg 'export\s+(async\s+)?function\s+middleware' --type ts -A 30 | rg 'await|fetch|http'`

> Removed 2026-09: OAuth flow tables and NextAuth/Passport/FastAPI code walkthroughs, JWT structure/rotation scripts, RBAC middleware examples, password-policy tables, CSRF/session/cookie tutorial steps — standard auth knowledge the model carries; the five house patterns above are what this config actually learned (Keycloak layering, JWE cache lifetime, cookie prefixes, middleware budget).

Attribution

darellchua2darellchua2
View sourceMore from darellchua2 →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Springboot Security

Java Spring Boot 服务中关于身份验证/授权、验证、CSRF、密钥、标头、速率限制和依赖安全的 Spring Security 最佳实践。

2456590 votes

Security Review

Use this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment/sensitive features. Provides comprehensive security checklist and patterns.

2456590 votes

Summarize Status

Write a short, colloquial summary for a Paperclip summary slot: open with the 1–3 specific, concrete actions the reader needs to take right now to unblock the work, then a brief plain-language status, streaming progress as it works.

798220 votes

Paperclip Task Bridge

Create, comment on, update, and list Paperclip tasks from Hermes using scoped Paperclip API credentials.

798220 votes

V3 Security Overhaul

Complete security architecture overhaul for claude-flow v3. Addresses critical CVEs (CVE-1, CVE-2, CVE-3) and implements secure-by-default patterns. Use for security-first v3 implementation.

701370 votes
View all in security →