authentication-patterns

Authentication and authorization patterns including OAuth2, JWT, RBAC, session management, and PKCE flows

Content Preview
---
name: authentication-patterns
description: Authentication and authorization patterns including OAuth2, JWT, RBAC, session management, and PKCE flows
---

# Authentication Patterns

## JWT Access and Refresh Tokens

```typescript
import jwt from "jsonwebtoken";

interface TokenPayload {
  sub: string;
  email: string;
  roles: string[];
}

function generateTokens(user: User) {
  const accessToken = jwt.sign(
    { sub: user.id, email: user.email, roles: user.roles },
    process.env.JWT_SECRE
How to Use

Recommended: Install to project (local)

mkdir -p .claude/skills
curl -o .claude/skills/authentication-patterns.md \
  https://raw.githubusercontent.com/rohitg00/awesome-claude-code-toolkit/main/skills/authentication-patterns/SKILL.md

Skill is scoped to this project only. Add .claude/skills/ to your .gitignoreif you don't want to commit it.

Alternative: Clone full repo

git clone https://github.com/rohitg00/awesome-claude-code-toolkit

Then reference at skills/authentication-patterns/SKILL.md

Related Skills