Skip to content
secondsky avatar

Oauth Implementation

OAuth 2.0 and OpenID Connect guide covering flow selection, Express code, and PKCE for public clients.

CCM score
52 of 100
skills.sh installs
430
GitHub stars
257
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the OAuth 2.0 flows (Authorization Code, Authorization Code with PKCE, Client Credentials, and Refresh Token) with a use-case table for choosing among them
  • Includes Express Authorization Code code with state validation, a PKCE verifier and challenge generator, and links to Python Flask and Java Spring Security references
  • Enforces HTTPS, strict redirect URI validation, HttpOnly cookie token storage, token rotation, and 15-minute access tokens
  • Designed for teams wiring third-party integrations, SSO, or token-based API access that need to avoid localStorage tokens and implicit flow

Install

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

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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' });
  }

Details

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

Questions

What does the oauth-implementation skill do?

The oauth-implementation skill guides an agent through OAuth 2.0 and OpenID Connect authentication with secure flows. It covers authorization code flow, PKCE, token refresh and scope management for third-party integrations, SSO systems and token-based API access.

How do I install the oauth-implementation skill?

Run npx -y skills add secondsky/claude-skills --skill oauth-implementation -y in your project. After that, the oauth-implementation skill lets the agent implement OAuth 2.0 flows and OpenID Connect in that project.

Which OAuth flow should oauth-implementation use for my app?

The oauth-implementation skill recommends the authorization code flow for web apps, and authorization code with PKCE for single-page and mobile apps. It also covers client credentials for service-to-service calls and refresh tokens for session renewal.

Does oauth-implementation include Python or Java examples?

Yes, the oauth-implementation skill points to a reference file with Python Flask and Authlib OIDC provider code, OpenID Connect discovery and JWKS endpoints, and a Java Spring Security OAuth2 server. It also covers token introspection and revocation.

More from secondsky/claude-skills

All 116

Similar to Oauth Implementation

More Backend & APIs