A skill your agent uses when a val needs to require login with a Val Town account — gating routes behind authentication, identifying the current user, building user-specific dashboards.

Apache-2.0Auto-check passedBackend & APIs

Install OAuth

skills CLI
$ npx skills add hashgraph-online/awesome-codex-plugins --skill oauth -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install hashgraph-online/awesome-codex-plugins oauth --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/hashgraph-online/awesome-codex-plugins.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/val-town/plugins/skills/oauth .claude/skills/oauth && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
oauth
GitHub stars
1.2k
Token cost
~1.1k tokens
SKILL.md length
329 words
Files
1
Skills in repo
686
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses when a val needs to require login with a Val Town account — gating routes behind authentication, identifying the current user, building user-specific dashboards.

  • A val needs to require login with a Val Town account — gating routes behind authentication
  • SKILL.md covers Imports, Wrapping your app, Reading the current user and Gating routes, plus 2 more sections
  • Reaches esm.town
  • Identifying the current user

What it does

OAuth is an agent skill from hashgraph-online/awesome-codex-plugins. Use when a val needs to require login with a Val Town account — gating routes behind authentication, identifying the current user, building user-specific dashboards. Covers std/oauth's oauthMiddleware and getOAuthUserData, the auto-managed /auth/ routes, and session behavior. For third-party OAuth providers (Google, GitHub, etc.) see the third-party-integrations skill instead.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering OAuth and OpenID Connect and Authentication. It works with GitHub and Hono. The repository describes itself as: A curated list of awesome OpenAI Codex / ChatGPT plugins, skills, and resources. The 1 Codex Marketplace. See live plugins at: https://hol.org/plugins/best-codex-plugins. The licence is Apache-2.0.

When your agent uses it

  • A val needs to require login with a Val Town account — gating routes behind authentication
  • Identifying the current user
  • Building user-specific dashboards

Example prompts

  • “/oauth”

What it can do on your machine

Read from SKILL.md and the folder at commit 78497e5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • esm.town

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

OAuth loads about 1.1k tokens when it runs. Until then it costs about 99 tokens; SKILL.md has 329 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~99
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from hashgraph-online/awesome-codex-plugins at commit 78497e5, republished under its Apache-2.0 licence (© hashgraph-online). 329 words, ~1,066 tokens.

Download SKILL.mdSave it as .claude/skills/oauth/SKILL.md (or your agent's skills folder).
name
oauth
description
Use when a val needs to require login with a Val Town account — gating routes behind authentication, identifying the current user, building user-specific dashboards. Covers std/oauth's `oauthMiddleware` and `getOAuthUserData`, the auto-managed `/auth/*` routes, and session behavior. For third-party OAuth providers (Google, GitHub, etc.) see the `third-party-integrations` skill instead.
triggers
oauth, auth, login, signin, sign-in, logout, session, user, authentication, account, gated, protected, private

OAuth (std/oauth)

Val Town provides zero-config "Log in with Val Town" via std/oauth. No database setup, no provider config — wrap your Hono fetch handler and you get login, logout, and session management for free. Sessions are stored in encrypted cookies and last 30 days.

This is for Val Town account login only. For Google / GitHub / Slack / etc. OAuth, see the third-party-integrations skill — those flows are documented per-service.

If the goal is to keep an app internal to a team rather than to give it its own logged-in users, restricting the val's app access is the simpler answer — the platform gates the endpoint before your code runs, and you write no auth code. See the restricted-access skill. Don't apply both to one val: a restricted val that also runs oauthMiddleware makes visitors authenticate twice.

Imports

ts
import {
  getOAuthUserData,
  oauthMiddleware,
} from "https://esm.town/v/std/oauth/middleware.ts";

Wrapping your app

oauthMiddleware(handler) takes your Hono fetch handler and returns a wrapped handler that injects three auto-managed routes:

  • GET /auth/login — starts the login flow
  • GET /auth/callback — completes the login flow
  • POST /auth/logout — clears the session

Export the wrapped handler as the val's default:

ts
import { Hono } from "npm:hono";
import { oauthMiddleware } from "https://esm.town/v/std/oauth/middleware.ts";

const app = new Hono();
app.onError((err) => Promise.reject(err));

app.get("/", (c) => c.text("hello"));

export default oauthMiddleware(app.fetch);

You don't write the /auth/* routes yourself — the middleware adds them. Don't shadow them in your own app.

Reading the current user

Call getOAuthUserData(rawRequest) from any route. In Hono, rawRequest is c.req.raw. It returns the session data if the request is authenticated, or null otherwise.

ts
interface SessionData {
  user: {
    id: string;
    username: string | null;
    email: string | null;
    bio: string | null;
    tier: "free" | "pro" | null;
    type: "user" | "org";
    url: string;
    links: {
      self: string;
      profileImageUrl: string | null;
    };
  };
  accessToken: string; // Val Town API token (act on behalf of the user)
  refreshToken?: string;
  idToken?: string;
  expiresAt: number; // Unix timestamp (ms)
  isOrgMember?: boolean; // true if user belongs to this val's org
}
ts
app.get("/", async (c) => {
  const session = await getOAuthUserData(c.req.raw);
  if (session?.user) {
    return c.html(
      `<p>Logged in as ${session.user.username}</p>` +
      `<form method="POST" action="/auth/logout"><button>Log out</button></form>`
    );
  }
  return c.html(`<a href="/auth/login">Log in with Val Town</a>`);
});

Gating routes

There's no built-in "require login" helper — gate routes by checking getOAuthUserData and returning a 401 or redirecting to /auth/login when the session is missing:

ts
app.get("/dashboard", async (c) => {
  const session = await getOAuthUserData(c.req.raw);
  if (!session?.user) return c.redirect("/auth/login");
  return c.html(`<h1>Welcome ${session.user.username}</h1>`);
});

What you don't need to configure

  • No env vars — credentials and redirect URLs are handled by the platform.
  • No callback URL setup — /auth/callback is wired automatically.
  • No session store — sessions live in encrypted cookies.

Verifying changes

After adding OAuth, call fetch_val_endpoint on a gated route to confirm it redirects or 401s when unauthenticated. The full login flow requires a real browser session and can't be exercised by fetch_val_endpoint alone — share the live URL and have the user try logging in.

© hashgraph-online, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/val-town/plugins/skills/oauth of hashgraph-online/awesome-codex-plugins.

Open the folder on GitHubat commit 78497e5

Compare with similar skills

OAuth next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

OAuth compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
OAuth this skillhashgraph-online/awesome-codex-plugins1.2k—~1.1kAutomated safety check: PassApache-2.0
GitHub OAuth Nango IntegrationAgentWorkforce/relay8661 repos~3.4kAutomated safety check: PassApache-2.0
Auth Setupbutterbase-ai/butterbase-skills534—~2.2kAutomated safety check: PassMIT
Atmos Authcloudposse/atmos1.4k—~4.2kAutomated safety check: PassApache-2.0
Better Autheinverne/dotfiles121—~4kAutomated safety check: NotesMIT
Nuxt Studiosecondsky/claude-skills227—~2.8kAutomated safety check: PassMIT

Similar skills

  • GitHub OAuth Nango Integration

    AgentWorkforce/relay

    A skill your agent uses when implementing GitHub OAuth + GitHub App authentication with Nango - provides two-connection pattern for user login and repo access with webhook handling

    866 GitHub starsUsed in 1 repo~3.4k tokens
    Backend & APIsAuto-check passed
  • Auth Setup

    butterbase-ai/butterbase-skills

    A skill your agent uses when configuring OAuth providers (Google/GitHub/Apple/X/etc.), setting up post-login auth hooks, tuning JWT lifetimes, or generating service API keys

    534 GitHub stars~2.2k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • Atmos Auth

    cloudposse/atmos

    Authentication and identity management: providers (SSO/SAML/OIDC/GCP/Atmos Pro), identities, keyring, identity chaining, login/exec/shell/console, and github/sts for private GitHub access

    1.4k GitHub stars~4.2k tokensUpdated today
    Backend & APIsAuto-check passed
  • Better Auth

    einverne/dotfiles

    Guide for implementing Better Auth - a framework-agnostic authentication and authorization framework for TypeScript.

    121 GitHub stars~4k tokensUpdated 29 days ago
    Backend & APIsAuto-check: notes
  • Nuxt Studio

    secondsky/claude-skills

    This skill should be used when the user asks to "set up Nuxt Studio", "configure Studio OAuth", "deploy Studio to Cloudflare", "add visual editor to Nuxt", "configure studio.domain.com subdomain"…

    227 GitHub stars~2.8k tokensUpdated 10 days ago
    Backend & APIsAuto-check passed
  • Auth

    aiskillstore/marketplace

    Authentication and access control skill for Next.js 15 + Supabase applications.

    430 GitHub stars~1.6k tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from hashgraph-online/awesome-codex-plugins

All 686 skills in this repo
  • Anime Reaction Gif

    hashgraph-online/awesome-codex-plugins

    Create original anime-style reaction stickers as looping GIFs and MP4 previews, using generated character pose sheets and timed key poses.

    1.2k GitHub stars~922 tokensUpdated today
    Auto-check passed
  • Calibredb

    hashgraph-online/awesome-codex-plugins

    Manage and query Calibre libraries with the calibredb CLI (local paths or Calibre Content server URLs).

    1.2k GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Rust API Test Harness

    hashgraph-online/awesome-codex-plugins

    A skill your agent uses when adding, changing, testing, or debugging Rust HTTP APIs and services, especially when Codex needs black-box integration tests, random-port app startup, real database test…

    1.2k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Art

    hashgraph-online/awesome-codex-plugins

    Make a studio's game look like something at build time — a cover from a real frame of the game (free), painted covers, backdrops, textures and character plates from image models through the…

    1.2k GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Game Balance Economy

    hashgraph-online/awesome-codex-plugins

    Balance game difficulty, resources, rewards, probability, progression, economies, and dominant strategies.

    1.2k GitHub stars~618 tokensUpdated today
    Auto-check passed
  • Manuscript Engagement Analytics

    hashgraph-online/awesome-codex-plugins

    Analyze nonfiction manuscripts for reader engagement signals, including heading-level word counts, slow starts, long slogs, weak takeaway titles, value pacing, beta-reader comment dropoff, and…

    1.2k GitHub stars~875 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about OAuth

What does OAuth do?

A skill your agent uses when a val needs to require login with a Val Town account — gating routes behind authentication, identifying the current user, building user-specific dashboards. OAuth is an agent skill from hashgraph-online/awesome-codex-plugins. Use when a val needs to require login with a Val Town account — gating routes behind authentication, identifying the current user, building user-specific dashboards.

When should I use OAuth?

OAuth fits situations like: A val needs to require login with a Val Town account — gating routes behind authentication; identifying the current user; building user-specific dashboards.

How do I install OAuth in Claude Code?

Run `npx skills add hashgraph-online/awesome-codex-plugins --skill oauth -a claude-code`. Or copy the skill folder (plugins/val-town/plugins/skills/oauth in hashgraph-online/awesome-codex-plugins) into .claude/skills/oauth in your project. Claude Code loads it when a task matches its description.

How do I install OAuth in Codex?

Run `npx skills add hashgraph-online/awesome-codex-plugins --skill oauth -a codex`. Or copy the skill folder (plugins/val-town/plugins/skills/oauth in hashgraph-online/awesome-codex-plugins) into .agents/skills/oauth in your project. Codex loads it when a task matches its description.

Can I use OAuth in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add hashgraph-online/awesome-codex-plugins --skill oauth -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/oauth, .gemini/skills/oauth, .github/skills/oauth and .opencode/skills/oauth in your project.

What does OAuth need to run?

SKILL.md names no scripts, command-line tools or credentials: OAuth is instructions for the agent only.

Does OAuth access the network?

SKILL.md names 1 domain. In commands or code: esm.town; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is OAuth safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does OAuth use?

OAuth is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does OAuth use?

About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to OAuth?

Skills that share tags, products or a category with OAuth: GitHub OAuth Nango Integration (AgentWorkforce/relay, 866 stars), Auth Setup (butterbase-ai/butterbase-skills, 534 stars), Atmos Auth (cloudposse/atmos, 1.4k stars) and Better Auth (einverne/dotfiles, 121 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains OAuth?

hashgraph-online (a GitHub organization) maintains it in hashgraph-online/awesome-codex-plugins, which has 1,242 GitHub stars. The repository holds 686 skills in this directory. The repository was last updated on October 8, 2026.

Source: hashgraph-online/awesome-codex-plugins on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.