/polymath-security:auth-designfrom polymath-security
Design authentication/authorization — OAuth2/OIDC flow choice, JWT vs opaque/session tokens, RBAC vs ABAC, SSO, token lifetime/refresh/revocation.
Ships in polymath-security. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Authentication proves who; authorization decides what. Conflating them, or hand-rolling either, is where breaches live. Pick standard flows and name where the token can be revoked.
Mode: analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked [TBD] or [VERIFY], never filled in.
polymath-security:auth-design.Not this when: you are threat-modeling a whole system (stride-threat-model) or reviewing a diff for vulns (owasp-review). This skill designs the authN/authZ mechanism itself.
aud/iss/exp validated, signature alg pinned (no alg:none), and a revocation story (short TTL + denylist or rotation). Rotate refresh tokens on every use and revoke the family on reuse (theft detection); for high-value APIs, sender-constrain tokens (DPoP or mTLS) so a stolen bearer token is useless. Never store tokens in localStorage in a browser app — prefer a backend-for-frontend with HttpOnly cookies.HttpOnly, Secure, SameSite, rotation on privilege change, idle + absolute timeout, fixation protection.Auth design: merchant dashboard + public refunds API
AuthN
web dashboard (SPA) OIDC Authorization Code + PKCE via a backend-for-frontend; HttpOnly, Secure, SameSite=Lax session cookie
public API clients OAuth2 Client Credentials; JWT access token, 10 min TTL
service-to-service mTLS (mesh identities); no shared secrets
Tokens
access JWT: RS256 pinned, iss/aud/exp validated; revocation = 10 min TTL + jti denylist for emergencies
refresh: rotated on every use; reuse revokes the whole family
AuthZ
model: RBAC for staff (admin, support, viewer) + ownership check (ABAC) on every merchant resource
enforced at: the API resource handlers — never from client-supplied roles
SSO: Okta via OIDC; groups → roles mapping in config; JIT provisioning; deprovision via SCIM
Secrets: client secrets in Vault, rotated 90d; admins require WebAuthn passkeys
Threat → control
token theft short TTL + refresh rotation + DPoP for the refunds API
replay jti + exp; nonces on the OIDC flow
privilege escalation server-side role check; role changes audited and alerted
IDOR ownership check on every merchant_id path parameter
alg:none).iss/aud/exp/signature and have a revocation story; sessions set the secure cookie flags.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mohammadbafkar/polymath --plugin polymath-security8 skills in this plugin
/compliance-mappingMap a compliance framework (SOC 2 / GDPR / ISO 27001 / HIPAA) to concrete technical controls and the evidence/artifacts each control needs for audit./crypto-reviewReview a cryptography choice — encryption at rest/in transit, key management + rotation, algorithm/mode selection, and common foot-guns (IV reuse, ECB, home-rolled crypto)./devsecops-pipelineDesign security gates into CI/CD — SAST, DAST, SCA/dependency, secret, and IaC scanning — with severity thresholds, a triage flow, and noise control.Other plugins' skills for the same job