oauth-auth

oauth-auth is a skill for Claude Code, Codex from medy-gribkov/arcana. It costs 26 tokens per session (3,394 once invoked), scanned B, original, Apache-2.0.

A guide to letting users sign in through another service and keeping their sessions secure. It covers OAuth2, OIDC, JWTs, refresh tokens, and login middleware.

In plain words
What is it for?
Building third-party login flows, validating identity tokens, managing sessions, rotating refresh tokens, and adding authentication middleware.
Why use it?
It helps prevent common login weaknesses, such as unsafe redirects, exposed session data, and poorly protected authorization tokens.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Building third-party login flows, validating identity tokens, managing sessions, rotating refresh tokens, and adding authentication middleware.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/medy-gribkov/arcana/oauth-auth
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add medy-gribkov/arcana --skill oauth-auth
Clone the repo
git clone --depth 1 https://github.com/medy-gribkov/arcana

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin oauth-auth/plugin install oauth-auth after adding the marketplace above.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for oauth-auth

README.md
[![agentmods](https://agentmods.dev/badge/skills/medy-gribkov/arcana/oauth-auth/github.svg)](https://agentmods.dev/skills/medy-gribkov/arcana/oauth-auth)
Your own site
<a href="https://agentmods.dev/skills/medy-gribkov/arcana/oauth-auth"><img src="https://agentmods.dev/badge/skills/medy-gribkov/arcana/oauth-auth/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for oauth-auth

Your own site · 80×15
<a href="https://agentmods.dev/skills/medy-gribkov/arcana/oauth-auth"><img src="https://agentmods.dev/badge/skills/medy-gribkov/arcana/oauth-auth.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,394 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00026 $0.03394
Opus 5 $0.00013 $0.01697
Sonnet 5 $0.00005 $0.00679
Haiku 4.5 $0.00003 $0.00339

Measured 10d ago against content hash 7b1bfac00328, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade B, and why

oauth-auth scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

const response = await fetch('https://provider.com/oauth/token', { method: 'POST',
skills/oauth-auth/SKILL.md · 521 lines

How it starts

The opening of the file, as written. The whole thing — 521 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OAuth and Authentication

Implement secure OAuth2 flows, JWT validation, session management, and authentication patterns.

OAuth2 Authorization Code Flow with PKCE

BAD: No PKCE, state stored in localStorage

// Client initiates OAuth without PKCE
const authUrl = `https://provider.com/oauth/authorize?client_id=${clientId}&redirect_uri=${redirectUri}&response_type=code`;
localStorage.setItem('oauth_state', Math.random().toString());
window.location.href = authUrl;

GOOD: PKCE with httpOnly cookie state

import crypto from 'crypto';

// Generate PKCE challenge
function generatePKCE() {
  const verifier = crypto.randomBytes(32).toString('base64url');
  const challenge = crypto
    .createHash('sha256')
    .update(verifier)
    .digest('base64url');
  return { verifier, challenge };
}

// Initiate OAuth with PKCE
export async function initiateOAuth(res: Response) {
  const { verifier, challenge } = generatePKCE();
  const state = crypto.randomBytes(32).toString('base64url');

  // Store verifier and state in httpOnly cookie
  res.setHeader('Set-Cookie', [
    `pkce_verifier=${verifier}; HttpOnly; Secure; SameSite=Lax; Max-Age=600`,
    `oauth_state=${state}; HttpOnly; Secure; SameSite=Lax; Max-Age=600`
  ]);

  const params = new URLSearchParams({
    client_id: process.env.OAUTH_CLIENT_ID!,
    redirect_uri: process.env.OAUTH_REDIRECT_URI!,
    response_type: 'code',
    scope: 'openid profile email',
    state,
    code_challenge: challenge,
    code_challenge_method: 'S256'
  });

  return `https://provider.com/oauth/authorize?${params}`;
}

Token Exchange and Validation

BAD: No validation, symmetric JWT with weak secret

// Exchange code without validating state
const response = await fetch('https://provider.com/oauth/token', {
  method: 'POST',
  body: JSON.stringify({ code, client_id: clientId, client_secret: secret })
});
const { access_token } = await response.json();

// Weak symmetric JWT
import jwt from 'jsonwebtoken';
const token = jwt.sign({ userId }, 'weak-secret', { expiresIn: '1h' });

Read the full file on GitHub · 521 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 521 lines · 26 tokens per session scan B 7b1bfac00328

Subscribe to this mod's changes

oauth-auth is a skill published in the GitHub repository medy-gribkov/arcana (1 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 26 tokens to every session and 3,394 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (sends data to an external url). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.