Backend JWT Authentication Skill
CommunitySecure API access with JWT-based user isolation.
Authorayesha-aziz123
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This skill provides a robust JWT-based authentication mechanism that validates tokens on every request, extracts user information, and enforces user isolation using a shared secret to protect APIs.
Core Features & Use Cases
- Middleware-based JWT verification: validate tokens using HS256 with a shared secret and extract user_id and email.
- User ID match enforcement: ensure the user_id from the JWT matches the URL path parameter to prevent cross-user access.
- Token generation & expiration: issue tokens after authentication with a 7-day expiration and maintain stateless sessions.
- Use Case: secure endpoints like /api/users/{user_id}/tasks so only the authenticated user can access their data.
Quick Start
Configure BETTER_AUTH_SECRET, install dependencies (FastAPI, python-jose, passlib), integrate the verify_jwt_token logic into your routes, then sign in to obtain a token and call a protected route using that token.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: Backend JWT Authentication Skill Download link: https://github.com/ayesha-aziz123/Hackathon_II/archive/main.zip#backend-jwt-authentication-skill Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.