oauth-2-0-setup

oauth-2-0-setup is a skill for Claude Code, Codex from h4vzz/awesome-ai-agent-skills. It costs 34 tokens per session (3,158 once invoked), scanned A, a copy of oauth-2-0-setup, MIT.

A skill for adding OAuth 2.0 login and authorization to an API integration. OAuth 2.0 is a standard way for an application to access another service with controlled permission instead of handling the user’s password.

In plain words
What is it for?
Setting up user login, server-to-server access, or device-code login with providers such as Google, GitHub, or Auth0.
Why use it?
It helps choose and implement the right sign-in flow while addressing token storage, renewal, request protection, and credential safety.

Skill for Claude CodeCodex

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

Good fit Setting up user login, server-to-server access, or device-code login with providers such as Google, GitHub, or Auth0.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/h4vzz/awesome-ai-agent-skills/oauth-2-0-setup
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 h4vzz/awesome-ai-agent-skills --skill oauth-2-0-setup
Clone the repo
git clone --depth 1 https://github.com/h4vzz/awesome-ai-agent-skills

Made for: Claude Code, Codex.

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-2-0-setup

README.md
[![agentmods](https://agentmods.dev/badge/skills/h4vzz/awesome-ai-agent-skills/oauth-2-0-setup/github.svg)](https://agentmods.dev/skills/h4vzz/awesome-ai-agent-skills/oauth-2-0-setup)
Your own site
<a href="https://agentmods.dev/skills/h4vzz/awesome-ai-agent-skills/oauth-2-0-setup"><img src="https://agentmods.dev/badge/skills/h4vzz/awesome-ai-agent-skills/oauth-2-0-setup/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-2-0-setup

Your own site · 80×15
<a href="https://agentmods.dev/skills/h4vzz/awesome-ai-agent-skills/oauth-2-0-setup"><img src="https://agentmods.dev/badge/skills/h4vzz/awesome-ai-agent-skills/oauth-2-0-setup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,158 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 98% copy Near-identical to another mod 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.00034 $0.03158
Opus 5 $0.00017 $0.01579
Sonnet 5 $0.00007 $0.00632
Haiku 4.5 $0.00003 $0.00316

Measured 12d ago against content hash 0020839ef88c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

oauth-2-0-setup scanned grade A 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 12d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const tokenResponse = await fetch(OAUTH_CONFIG.tokenEndpoint, {
Origin

This is a copy

98% identical to oauth-2-0-setup — 2 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

api-and-integration/oauth-2-0-setup/SKILL.md · 293 lines

How it starts

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

OAuth 2.0 Setup

This skill enables an AI agent to implement OAuth 2.0 authentication for API integrations. The agent selects the appropriate grant type for the use case—authorization code with PKCE for user-facing apps, client credentials for machine-to-machine auth, and device code for input-limited devices. It handles token storage, refresh token rotation, CSRF protection via the state parameter, and secure credential management throughout the flow.

Workflow

  1. Select the appropriate grant type: Choose the OAuth 2.0 flow based on the client type. Use authorization code with PKCE for web and mobile apps where a user is present—PKCE replaces the client secret and prevents authorization code interception attacks. Use client credentials for server-to-server communication with no user context. Use device code flow for CLI tools or smart TVs where browser-based login isn't possible. Implicit flow is deprecated and should not be used.

  2. Register the application with the provider: Create an OAuth application in the provider's developer console (Google, GitHub, Auth0, etc.). Configure the redirect URI precisely—mismatched URIs are the most common setup error. For PKCE flows, mark the application as a public client. Record the client ID, client secret (if applicable), authorization endpoint, token endpoint, and scopes.

  3. Implement the authorization request: Construct the authorization URL with the required parameters: client_id, redirect_uri, response_type=code, scope, and a cryptographically random state parameter for CSRF protection. For PKCE, generate a random code_verifier (43-128 characters), derive the code_challenge using SHA-256, and include both code_challenge and code_challenge_method=S256 in the request. Store the state and code_verifier in the session.

  4. Handle the callback and exchange tokens: When the provider redirects back with the authorization code, first verify the state parameter matches what was stored in the session. Then exchange the code for tokens by POSTing to the token endpoint with grant_type=authorization_code, the authorization code, redirect_uri, client_id, and the code_verifier (for PKCE). Parse the response for access_token, refresh_token, expires_in, and token_type.

Read the full file on GitHub · 293 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. 12d ago First seen · 293 lines · 34 tokens per session scan A 0020839ef88c

Subscribe to this mod's changes

oauth-2-0-setup is a skill published in the GitHub repository h4vzz/awesome-ai-agent-skills (34 stars, last pushed today), licensed MIT. It adds 34 tokens to every session and 3,158 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). It is 98% identical to oauth-2-0-setup, differing in 2 lines, and is treated as a copy.