Install
$ agentstack add skill-eaescob-resiliency-skills-auth ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ● Environment & secrets Used
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Authentication
Implement secure authentication for web applications with framework-appropriate providers.
Provider Selection
Select provider based on framework and backend:
| Framework | Default Provider | If Using Supabase Backend | |-----------|-----------------|---------------------------| | Next.js | NextAuth | Supabase Auth | | Express | Passport.js | Supabase Auth | | Go | golang-jwt | Supabase Auth | | React (SPA) | Depends on backend | Supabase Auth |
Decision rule: If user selected Supabase for database/storage, use Supabase Auth. Otherwise, use framework default.
Workflow
- Detect or confirm framework - Ask if unclear
- Check backend choice - If Supabase, recommend Supabase Auth
- Select auth provider - Based on matrix above
- Generate auth configuration - Provider setup, env vars
- Create middleware/guards - Route protection
- Generate protected route patterns - Apply to API routes
- Add session management - Token refresh, logout
Implementation by Framework
Next.js
See [references/nextjs.md](references/nextjs.md) for:
- NextAuth setup with providers (Google, GitHub, credentials)
- Middleware-based route protection
- Server component auth checks
- API route protection
Express
See [references/express.md](references/express.md) for:
- Passport.js strategy configuration
- Session vs JWT authentication
- Route middleware patterns
- Token refresh handling
Go
See [references/go.md](references/go.md) for:
- golang-jwt token generation and validation
- Middleware patterns for protected routes
- Session management options
- Secure cookie handling
Supabase (Any Framework)
See [references/supabase.md](references/supabase.md) for:
- Supabase Auth client setup
- Row Level Security (RLS) patterns
- Session handling across frameworks
- OAuth provider configuration
Security Requirements
All implementations must include:
- Secure token storage - HttpOnly cookies preferred over localStorage
- CSRF protection - Required for cookie-based auth
- Token expiration - Access tokens < 15min, refresh tokens < 7 days
- Secure headers - Set appropriate security headers
- Input validation - Validate all auth inputs server-side
- Rate limiting - Protect login endpoints from brute force
Environment Variables
Generate .env.example with required variables (never commit actual secrets):
# Auth Provider
AUTH_SECRET= # Required: openssl rand -base64 32
AUTH_URL= # Production URL
# OAuth Providers (if applicable)
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
# Supabase (if applicable)
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY= # Server-side only
Route Protection Patterns
Public Routes (no auth required)
/- Landing page/login,/signup- Auth pages/api/auth/*- Auth endpoints/public/*- Public assets
Protected Routes (auth required)
/dashboard/*- User dashboard/api/*(except auth) - API endpoints/settings/*- User settings/admin/*- Admin pages (+ role check)
Always default to protected - explicitly whitelist public routes rather than blacklisting protected ones.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: eaescob
- Source: eaescob/resiliency_skills
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.