oauth

Implement OAuth 2.0 and OpenID Connect authorization code flows with PKCE.

14|1|Updated Dec 5, 2025
One-click install
npx skills add https://github.com/jpoutrin/product-forge --skill oauth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: oauth
Source: https://github.com/jpoutrin/product-forge/tree/main/plugins/security-compliance/skills/oauth
Command: npx skills add https://github.com/jpoutrin/product-forge --skill oauth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Implementing secure OAuth 2.0 and OpenID Connect authentication and authorization flows can be complex and error-prone. This Skill provides clear patterns and best practices to simplify integration with identity providers like Google or GitHub, ensuring robust security.

Core Features & Use Cases

  • OAuth 2.0 Flows: Guidance on Authorization Code Flow (recommended for web apps) and PKCE Extension (required for SPAs/mobile).
  • Token Management: Patterns for securely handling access tokens and refresh tokens, including refresh strategies.
  • Security Best Practices: Essential guidelines like always using HTTPS, strict redirect URI validation, and secure token storage.
  • OpenID Connect: Explanations and examples for extending OAuth 2.0 to include user identity claims.
  • Use Case: Implementing a "Login with Google" feature in your web application, designing a secure API authorization system, or integrating with a custom identity provider.

Quick Start

Use the oauth skill to generate a Python code snippet for implementing the Authorization Code Flow with PKCE for a new web application.

Frequently Asked Questions about oauth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement OAuth 2.0 authorization code flow for a web application?

OAuth 2.0 authorization code flow is the recommended pattern for web apps to authenticate users with providers like Google or GitHub. It involves redirecting users to the provider's login page, receiving an authorization code, exchanging it for tokens server-side, and securely storing tokens for API access. This Skill provides step-by-step guidance and code patterns for each stage.

What is PKCE and why do I need it for single-page apps and mobile apps?

PKCE (Proof Key for Code Exchange) is a security extension to OAuth 2.0 required for public clients like SPAs and mobile apps that cannot securely store secrets. It prevents authorization code interception attacks by generating a code verifier and challenge on the client, validating them during token exchange. This Skill covers PKCE implementation patterns for these platforms.

How do I securely handle access tokens and refresh tokens?

Secure token handling involves storing access tokens in memory, refresh tokens in httpOnly cookies, validating token expiry, and implementing refresh strategies to obtain new access tokens without re-authentication. This Skill provides patterns for token lifecycle management, rotation, and secure storage across web, mobile, and backend services.

What's the difference between OAuth 2.0 and OpenID Connect?

OAuth 2.0 is an authorization protocol for delegated access to APIs; OpenID Connect extends it to include user identity claims via ID tokens. OpenID Connect adds an identity layer, user info endpoints, and standardized claims. This Skill explains both protocols and shows how to integrate them for authentication and authorization.

Do I need HTTPS for OAuth 2.0 implementation?

Yes, HTTPS is mandatory for OAuth 2.0 deployments to protect tokens and authorization codes in transit. This Skill emphasizes HTTPS enforcement and strict redirect_uri validation as core security requirements to prevent token interception and phishing attacks.

How do I validate ID tokens from an identity provider?

ID token validation requires verifying the token signature using the provider's public keys, checking expiry, validating audience (aud) and issuer (iss) claims, and confirming the nonce matches your request. This Skill provides verification patterns and best practices for integrating custom and standard identity providers.