secondsky avatar

Oauth Implementation

Handles OAuth 2.0 and OpenID Connect flows with proper security patterns baked in. You get authorization code flow with PKCE for SPAs and mobile apps, client credentials for service-to-service auth, and token refresh logic. The Express examples show state validation, secure token exchange, and the Python/Java references cover running your own OIDC provider if needed. What's good here is the explicit security checklist: PKCE for public clients, HttpOnly cookies for tokens, 15-minute access token lifetimes. It won't hold your hand on provider-specific quirks, but if you need to wire up Google/GitHub login or build federated auth, this covers the OAuth fundamentals without the usual footguns.

skills.sh installs
422
GitHub stars
248
last updated
Aug 21, 2026

Install

$ npx -y skills add secondsky/claude-skills --skill oauth-implementation --agent claude-code

Installs into .claude/skills of the current project.

Files

OAuth Implementation

Implement OAuth 2.0 and OpenID Connect for secure authentication.

OAuth 2.0 Flows

FlowUse Case
Authorization CodeWeb apps (most secure)
Authorization Code + PKCESPAs, mobile apps
Client CredentialsService-to-service
Refresh TokenSession renewal

Authorization Code Flow (Express)

const express = require('express');
const jwt = require('jsonwebtoken');

// Step 1: Redirect to authorization
app.get('/auth/login', (req, res) => {
  const state = crypto.randomBytes(16).toString('hex');
  req.session.oauthState = state;

  const params = new URLSearchParams({
    client_id: process.env.CLIENT_ID,
    redirect_uri: process.env.REDIRECT_URI,
    response_type: 'code',
    scope: 'openid profile email',
    state
  });

  res.redirect(`${PROVIDER_URL}/authorize?${params}`);
});

// Step 2: Handle callback
app.get('/auth/callback', async (req, res) => {
  if (req.query.state !== req.session.oauthState) {
    return res.status(400).json({ error: 'Invalid state' });
  }

Sponsors

Details

Repository
github.com/secondsky/claude-skills
Categories
Backend & APIs, Security
First seen
Jun 3, 2026

More from secondsky/claude-skills

All 146
1davila7 avatarchromadavila7/claude-code-templatesOpen-source embedding database for AI applications. Store embeddings and metadata, perform vector and full-text search, filter by metadata. Simple 4-function AP421skills.sh installs
2davila7 avatartelegram-mini-appdavila7/claude-code-templatesExpert in building Telegram Mini Apps (TWA) - web apps that run inside Telegram with native-like experience. Covers the TON ecosystem, Telegram Web App API, pay420skills.sh installs
3xcrawl-api avatarxcrawlxcrawl-api/xcrawl-skillsUse this skill as the default XCrawl entry point for direct XCrawl requests, including single-URL fetch, format selection, sync or async execution, and JSON ext420skills.sh installs
4secondsky avataridempotency-handlingsecondsky/claude-skillsIdempotent API operations with idempotency keys, Redis caching, DB constraints. Use for payment systems, webhook retries, safe retries, or encountering duplicat415skills.sh installs
5davila7 avatarshopify-developmentdavila7/claude-code-templatesBuild Shopify apps, extensions, themes using GraphQL Admin API, Shopify CLI, Polaris UI, and Liquid. TRIGGER: "shopify", "shopify app", "checkout extension", "a411skills.sh installs
6jezweb avatarcloudflare-d1jezweb/claude-skillsBuild with D1 serverless SQLite database on Cloudflare's edge. Use when: creating databases, writing SQL migrations, querying D1 from Workers, handling relation408skills.sh installs