jpskill.com
🛠️ 開発・MCP コミュニティ

oauth-implementation

Implement secure OAuth 2.0, OpenID Connect (OIDC), JWT authentication, and SSO integration. Use when building secure authentication systems for web and mobile applications.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o oauth-implementation.zip https://jpskill.com/download/21488.zip && unzip -o oauth-implementation.zip && rm oauth-implementation.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/21488.zip -OutFile "$d\oauth-implementation.zip"; Expand-Archive "$d\oauth-implementation.zip" -DestinationPath $d -Force; ri "$d\oauth-implementation.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して oauth-implementation.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → oauth-implementation フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
5

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

OAuth の実装

目次

概要

業界標準の OAuth 2.0 および OpenID Connect 認証フローを、JWT トークン、リフレッシュトークン、およびセキュアなセッション管理で実装します。

使用する場面

  • ユーザー認証システム
  • サードパーティ API 連携
  • シングルサインオン (SSO) の実装
  • モバイルアプリ認証
  • マイクロサービスセキュリティ
  • ソーシャルログイン連携

クイックスタート

最小限の動作例:

// oauth-server.js - Complete OAuth 2.0 implementation
const express = require("express");
const jwt = require("jsonwebtoken");
const crypto = require("crypto");
const bcrypt = require("bcrypt");

class OAuthServer {
  constructor() {
    this.app = express();
    this.clients = new Map();
    this.authorizationCodes = new Map();
    this.refreshTokens = new Map();
    this.accessTokens = new Map();

    // JWT signing keys
    this.privateKey = process.env.JWT_PRIVATE_KEY;
    this.publicKey = process.env.JWT_PUBLIC_KEY;

    this.setupRoutes();
  }

  // Register OAuth client
  registerClient(clientId, clientSecret, redirectUris) {
    this.clients.set(clientId, {
      clientSecret: bcrypt.hashSync(clientSecret, 10),
// ... (see reference guides for full implementation)

リファレンスガイド

references/ ディレクトリにある詳細な実装:

ガイド 内容
Node.js OAuth 2.0 Server Node.js OAuth 2.0 サーバー
Python OpenID Connect Implementation Python OpenID Connect の実装
Java Spring Security OAuth Java Spring Security OAuth

ベストプラクティス

✅ 実施すべきこと

  • パブリッククライアントには PKCE を使用する
  • トークンローテーションを実装する
  • トークンを安全に保存する
  • すべての場所で HTTPS を使用する
  • リダイレクト URI を検証する
  • レート制限を実装する
  • 短寿命のアクセストークンを使用する
  • 認証イベントをログに記録する

❌ 実施すべきでないこと

  • トークンを localStorage に保存する
  • インプリシットフローを使用する
  • state パラメータを省略する
  • クライアントシークレットを公開する
  • オープンリダイレクトを許可する
  • 弱い署名キーを使用する
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

OAuth Implementation

Table of Contents

Overview

Implement industry-standard OAuth 2.0 and OpenID Connect authentication flows with JWT tokens, refresh tokens, and secure session management.

When to Use

  • User authentication systems
  • Third-party API integration
  • Single Sign-On (SSO) implementation
  • Mobile app authentication
  • Microservices security
  • Social login integration

Quick Start

Minimal working example:

// oauth-server.js - Complete OAuth 2.0 implementation
const express = require("express");
const jwt = require("jsonwebtoken");
const crypto = require("crypto");
const bcrypt = require("bcrypt");

class OAuthServer {
  constructor() {
    this.app = express();
    this.clients = new Map();
    this.authorizationCodes = new Map();
    this.refreshTokens = new Map();
    this.accessTokens = new Map();

    // JWT signing keys
    this.privateKey = process.env.JWT_PRIVATE_KEY;
    this.publicKey = process.env.JWT_PUBLIC_KEY;

    this.setupRoutes();
  }

  // Register OAuth client
  registerClient(clientId, clientSecret, redirectUris) {
    this.clients.set(clientId, {
      clientSecret: bcrypt.hashSync(clientSecret, 10),
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

Guide Contents
Node.js OAuth 2.0 Server Node.js OAuth 2.0 Server
Python OpenID Connect Implementation Python OpenID Connect Implementation
Java Spring Security OAuth Java Spring Security OAuth

Best Practices

✅ DO

  • Use PKCE for public clients
  • Implement token rotation
  • Store tokens securely
  • Use HTTPS everywhere
  • Validate redirect URIs
  • Implement rate limiting
  • Use short-lived access tokens
  • Log authentication events

❌ DON'T

  • Store tokens in localStorage
  • Use implicit flow
  • Skip state parameter
  • Expose client secrets
  • Allow open redirects
  • Use weak signing keys

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。