Api Authentication
Secure API authentication guide covering JWT, OAuth 2.0, API keys, and session management with best practices.
- CCM score
- 39 of 100
- skills.sh installs
- 613
- GitHub stars
- 396
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers JWT, OAuth 2.0, API key, and session-based authentication for securing endpoints and user login/logout flows
- Includes a Node.js Express login example with bcrypt password verification, plus reference guides for JWT, OAuth 2.0, API keys, and Python
- Guides token handling: HttpOnly cookies, refresh token rotation, expiration limits, and rate limiting on auth endpoints
- Designed for developers securing APIs, managing access and refresh tokens, or integrating OAuth 2.0 providers
Install
$ npx -y skills add aj-geddes/useful-ai-prompts --skill api-authentication -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
API Authentication
Table of Contents
Overview
Implement comprehensive authentication strategies for APIs including JWT tokens, OAuth 2.0, API keys, and session management with proper security practices.
When to Use
- Securing API endpoints
- Implementing user login/logout flows
- Managing access tokens and refresh tokens
- Integrating OAuth 2.0 providers
- Protecting sensitive data
- Implementing API key authentication
Quick Start
Minimal working example:
// Node.js JWT Implementation
const express = require('express');
const jwt = require('jsonwebtoken');
const bcrypt = require('bcrypt');
const app = express();
const SECRET_KEY = process.env.JWT_SECRET || 'your-secret-key';
const REFRESH_SECRET = process.env.REFRESH_SECRET || 'your-refresh-secret';
// User login endpoint
app.post('/api/auth/login', async (req, res) => {
try {
const { email, password } = req.body;
Details
- Repository
- github.com/aj-geddes/useful-ai-prompts
- Categories
- Backend & APIs, Security
- First seen
- Jun 3, 2026
More from aj-geddes/useful-ai-prompts
All 258- Refactor Legacy Code612
- Performance Testing611
- Competitor Analysis610
- Security Testing610
- Frontend Accessibility607
- Design Patterns Implementation601
- Data Cleaning Pipeline600
- Aws S3 Management599
- Database Schema Design599
- Database Query Optimization594
- Database Backup Restore593
- Memory Leak Detection593
- Technical Roadmap Planning584
- Accessibility Testing583
- Push Notification Setup582
- Database Schema Documentation579
- Data Visualization576
- App Store Deployment571
- Mobile App Debugging571
- Security Audit Logging571
- Bundle Size Optimization569
- Process Mapping567
- Integration Testing564
- Oauth Implementation560
Similar to Api Authentication
More Backend & APIsauth-implementation-patternswshobson/agents21.4K installsCatalog-style summary of authentication and authorization patterns covering JWT, OAuth2, sessions, and RBAC.
oauth-implementationaj-geddes/useful-ai-prompts560 installsSecure OAuth 2.0, OIDC, and JWT authentication guide with reference implementations for Node.js, Python, and Java.
session-managementaj-geddes/useful-ai-prompts469 installsSecure session management with JWT tokens, refresh cycles, session storage, logout handling, and CSRF protection.
jwt-authenticationpluginagentmarketplace/custom-plugin-nodejs227 installsNode.js JWT authentication with access and refresh tokens, plus role-based access control middleware.
api-security-best-practicesdavila7/claude-code-templates470 installsComprehensive guide for building secure REST, GraphQL, and WebSocket APIs with auth, validation, and rate limiting.
auth-patternsdavepoon/buildwithclaude183 installsReference guide for authentication in Next.js covering NextAuth.js (Auth.js) setup, middleware-based route protection, and session handling.