Skip to content
aj-geddes avatar

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
View on GitHub

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 -y

Installs 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

Similar to Api Authentication

More Backend & APIs