Jwt Authentication
Node.js JWT authentication with access and refresh tokens, plus role-based access control middleware.
- CCM score
- 37 of 100
- skills.sh installs
- 227
- GitHub stars
- 2
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers registration, login, protected routes, token refresh, and password reset flows for Express apps
- Includes code for
generateToken,register,login,authenticate,authorize, andrefreshAccessTokenusingjsonwebtokenandbcryptjs - Enforces short-lived access tokens (15 minutes to 1 hour), longer refresh tokens stored in the database, and bcrypt password hashing
- Suited to stateless REST APIs, mobile backends, and microservices that need authentication without server-side sessions
Install
$ npx -y skills add pluginagentmarketplace/custom-plugin-nodejs --skill jwt-authentication -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
JWT Authentication Skill
Implement secure, scalable authentication in Node.js applications using JSON Web Tokens.
Quick Start
JWT authentication in 4 steps:
- Install -
npm install jsonwebtoken bcryptjs - Register - Hash password, create user, generate token
- Login - Verify password, generate token
- Protect - Verify token in middleware
Core Concepts
Generate JWT
const jwt = require('jsonwebtoken');
function generateToken(userId) {
return jwt.sign(
{ id: userId },
process.env.JWT_SECRET,
{ expiresIn: '1h' }
);
}
function generateRefreshToken(userId) {
return jwt.sign(
{ id: userId },
process.env.JWT_REFRESH_SECRET,
{ expiresIn: '7d' }
);
}
User Registration
const bcrypt = require('bcryptjs');
async function register(req, res) {
const { email, password, name } = req.body;
// Check if user exists
const existingUser = await User.findOne({ email });
if (existingUser) {
return res.status(409).json({ error: 'User already exists' });
}
// Hash password
const hashedPassword = await bcrypt.hash(password, 10);
Details
- Repository
- github.com/pluginagentmarketplace/custom-plugin-nodejs
- Categories
- Backend & APIs, Security
- First seen
- Jun 3, 2026
Questions
What does the jwt-authentication skill help me build in Node.js?
The jwt-authentication skill implements secure JWT authentication in Node.js applications with access and refresh tokens. It also covers role-based access control, so routes can be limited to users with specific roles.
How do I install the jwt-authentication skill?
Run npx -y skills add pluginagentmarketplace/custom-plugin-nodejs --skill jwt-authentication -y in your project. After that, the agent can use the skill to write JWT login, registration and middleware code.
Who is the jwt-authentication skill for?
It suits developers building stateless REST APIs, mobile app backends or microservices that need token-based login. The skill walks through registration, login, token refresh and password reset flows in Node.js.
Where does jwt-authentication sit in the Backend and APIs category?
This skill is listed in the Backend and APIs category on Claude Marketplaces, alongside entra-app-registration, neon, firebase-basics, firebase-auth-basics and workers-best-practices. It focuses on JWT token handling, access and refresh tokens, and role checks for Node.js servers.
More from pluginagentmarketplace/custom-plugin-nodejs
All 4Similar to Jwt Authentication
More Backend & APIsapi-authenticationaj-geddes/useful-ai-prompts614 installsSecure API authentication guide covering JWT, OAuth 2.0, API keys, and session management with best practices.
auth-implementation-patternswshobson/agents21.7K installsCatalog-style summary of authentication and authorization patterns covering JWT, OAuth2, sessions, and RBAC.
auth-patternsdavepoon/buildwithclaude184 installsReference guide for authentication in Next.js covering NextAuth.js (Auth.js) setup, middleware-based route protection, and session handling.
session-managementsecondsky/claude-skills441 installsSecure session management guide covering JWT access and refresh tokens, Redis storage, and cookie hardening.
nextauth-authenticationmindrally/skills1.2K installsSetup guide for NextAuth.js v5 in Next.js covering providers, JWT and database sessions, and route protection.
jwt-securitymindrally/skills1.7K installsGuidelines for JWT authentication covering token creation, validation, storage, and refresh, with concrete security rules.