# jwt-authentication

Guides your coding agent in implementing JWT authentication for Node.js, covering token pairs, password hashing, and role checks.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 227 installs · ★ 2 repo stars
- Author: pluginagentmarketplace
- License: LicenseRef-Proprietary · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pluginagentmarketplace/custom-plugin-nodejs/tree/HEAD/skills/jwt-authentication/SKILL.md
- Updated: 2026-01-07
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/jwt-authentication

## What it does

This skill equips coding assistants with patterns for JSON Web Token authentication in Node.js. It outlines user registration, login pipelines, access and refresh token creation, plus Bearer header inspection middleware.

The workflow relies on standard security conventions. Passwords get hashed with `bcryptjs`, access tokens expire quickly, and refresh tokens require database storage. The skill also covers role-based access control and token-based password resets. Without `jsonwebtoken` and `bcryptjs` installed in your project, the suggested code cannot run.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-nodejs --skill jwt-authentication -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/jwt-authentication/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/jwt-authentication/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-nodejs --skill jwt-authentication -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/jwt-authentication/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-nodejs --skill jwt-authentication -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/jwt-authentication/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install pluginagentmarketplace/custom-plugin-nodejs skills/jwt-authentication
```

2. **Manually: put the files in place**
- File: `.github/skills/jwt-authentication/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-nodejs --skill jwt-authentication -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/pluginagentmarketplace/custom-plugin-nodejs --path skills/jwt-authentication
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/jwt-authentication/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-nodejs --skill jwt-authentication -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/pluginagentmarketplace/custom-plugin-nodejs/tree/HEAD/skills/jwt-authentication/SKILL.md

## When to use it
- issue access and refresh token pairs
- inspect Bearer tokens inside route middleware
- restrict API endpoints with role-based checks
- handle password reset flows using short-lived tokens

## Example prompts
- Create an Express authentication middleware that validates JWT Bearer tokens
- Write login and registration handlers using bcryptjs password hashing
- Set up a role-based access control middleware for admin routes

## Similar
- [authentication-patterns](https://affpapa.org/en/nevibecode/skills/rohitg00-authentication-patterns.md) — skill · ★ 2858 repo stars
- [add-authentication-system](https://affpapa.org/en/nevibecode/commands/add-authentication-system.md) — command · 382 installs
- [jwt-security](https://affpapa.org/en/nevibecode/skills/jwt-security.md) — skill · 1600 installs
- [jwt-validate](https://affpapa.org/en/nevibecode/skills/jwt-validate.md) — skill · 672 installs
- [api-authentication](https://affpapa.org/en/nevibecode/skills/api-authentication.md) — skill · 613 installs
- [implementing-jwt-signing-and-verification](https://affpapa.org/en/nevibecode/skills/implementing-jwt-signing-and-verification.md) — skill · 294 installs

From the same set: [pluginagentmarketplace/custom-plugin-nodejs](https://affpapa.org/en/nevibecode/by/pluginagentmarketplace/custom-plugin-nodejs.md) — 5 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
