• Projects
  • Service
  • About
  • branding.bz
  • Podcast
  • Tips
  • FAQ
  • Recruit
  • Download
  • Contact
  • branding.bz(ブランド構築SaaS)
  • DESIGN NOW(デザインメディア)
  • X
  • LinkedIn
  • Spotify
  • Facebook

213-0011 神奈川県川崎市高津区久本3-6-7-303

© 2026 ID INC. All rights reserved

claude-skills/スキル
SKILLKnowledge Worksecurity

auth0-dpop

プラグイン
Auth0
ライセンス
Apache-2.0
ソース
GitHub で見る ↗
説明

次のような場合に使用: APIの呼び出しを保護するため、盗まれても再利用できない端末にひも付いたアクセストークン(認証情報)を使う際に、DPoP(デバイスが本物であることを証明する仕組み)を追加する必要があるとき。また、ユーザーが「トークンをクライアントにひも付ける」「トークンの盗難を防ぐ」「送信元を限定したトークン」といった指示をした場合にも活用できます。

原文を表示

Use when adding DPoP (Demonstrating Proof-of-Possession) token binding to protect API calls with device-bound, sender-constrained access tokens that cannot be replayed if stolen. Also use when a user says "bind tokens to the client", "prevent token theft", or "sender-constrained tokens".

ユースケース
  • APIの呼び出しを保護する必要があるとき
  • トークンの盗難を防ぐ必要があるとき
  • トークンをクライアントにひも付けるとき
  • 送信元を限定したトークンが必要なとき
本文(日本語訳)

Auth0 DPoP ガイド

アクセストークンをクライアントの暗号化キーに紐付け、盗まれたトークンが再利用されるのを防ぎます。


概要

DPoP とは何か

DPoP(Demonstrating Proof-of-Possession=所有証明の実証)は、RFC 9449 で定義された OAuth 2.0 のメカニズムです。アクセストークンをクライアントが保有する暗号化キーペアに暗号学的に紐付けます。各 API リクエストには短命の署名付き JWT(DPoP プルーフ)が含まれ、送信者が秘密鍵を保有していることを証明します。盗まれたトークンだけでは、攻撃者によって再利用されることはできません。

このスキルを使用する場合

  • 高額な API 呼び出しをトークン盗難と再生攻撃から守る
  • 送信者に紐付いたトークンを求めるセキュリティやコンプライアンス要件を満たす
  • 高いセキュリティが必要な保護された Auth0 API を呼び出す SPA(シングルページアプリケーション)または Vanilla JS アプリ

このスキルを使用しない場合

  • SSR/サーバーサイド環境 — DPoP はブラウザに保管された秘密鍵に依存しており、サーバーサイド(Next.js、Nuxt など)では安全に使用できません
  • DPoP に対応していない API — リソースサーバーは DPoP トークン形式を受け入れるように設定される必要があります。Bearer 形式のみの API は DPoP プルーフを拒否します
  • トークン共有が必要なフロー — DPoP トークンは 1 つのキーペアに紐付いており、別のクライアントに転送したり再利用したりはできません

必要な条件

  • DPoP 対応の認可サーバーを持つ Auth0 テナント
  • DPoP トークン形式が有効になっているリソースサーバー
  • 以下のいずれかを使用するブラウザ SPA:@auth0/auth0-vue、@auth0/auth0-react、@auth0/auth0-angular、@auth0/auth0-spa-js
  • 本番環境での HTTPS(Auth0 が DPoP に要求)

主要概念

概念 説明
DPoP プルーフ 各リクエストに添付される短命の署名付き JWT で、キー所有を証明
DPoP ノンス サーバーが発行し、プルーフに含める値で再生攻撃を防止
useDpop: true DPoP プルーフの自動生成を有効にする SDK オプション
createFetcher() fetch 互換の関数を返す SDK ヘルパー。プルーフ処理を自動で取り扱う
UseDpopNonceError サーバーがフライト中にノンスを変更したときにスロー(送出)されるエラー。新しいノンスで再試行

ステップ 1:API で DPoP を有効にする

Auth0 ダッシュボード経由

  1. Applications → APIs に移動
  2. SPA が呼び出す API を選択
  3. Settings タブで、API 識別子が audience と一致することを確認
  4. ダッシュボード内の追加トグルは不要です — API リソースサーバーが DPoP トークンを受け入れるよう設定されている場合、クライアントが リクエストごとに DPoP を有効にします

Auth0 CLI 経由

# 現在のリソースサーバー設定を確認
auth0 api get "resource-servers" | jq '.[] | select(.identifier == "https://your-api-identifier")'

# API で DPoP トークン形式を有効化
auth0 api patch "resource-servers/{API_ID}" \
  --data '{"token_dialect": "access_token_authz"}'

{API_ID} は上記の GET 呼び出しから返された ID に置き換えてください。


ステップ 2:アプリケーションを設定する

すべてのフレームワーク共通のパターン

  1. Auth0 クライアント/プロバイダ設定に useDpop: true を audience と一緒に追加
  2. トークンを手動で添付する代わりに createFetcher() を使用 — SDK はプルーフ生成、ノンス管理、ヘッダーの注入を自動で処理します
  3. サーバーがノンスを変更する場合に備えて UseDpopNonceError を処理

環境変数

.env に API の audience が含まれていることを確認してください:

# Vite
VITE_AUTH0_DOMAIN=your-tenant.auth0.com
VITE_AUTH0_CLIENT_ID=your-client-id
VITE_AUTH0_AUDIENCE=https://your-api-identifier

追加リソース

フレームワーク例

サポートされているすべてのフレームワークの実装例:

  • Vue.js
  • React
  • Angular
  • auth0-spa-js(Vanilla JS)

統合ガイド

エラーハンドリングとトラブルシューティング:

  • UseDpopNonceError — ノンス変更の処理
  • よくある問題

関連スキル

  • auth0-vue - Vue.js Auth0 統合
  • auth0-react - React Auth0 統合
  • auth0-angular - Angular Auth0 統合
  • auth0-spa-js - Vanilla JS / フレームワーク非依存 SPA 統合
  • auth0-mfa - 多要素認証

参考資料

  • Auth0 DPoP ドキュメント
  • RFC 9449 — OAuth 2.0 Demonstrating Proof of Possession
  • auth0-spa-js リリース
原文(English)を表示

Auth0 DPoP Guide

Bind access tokens to the client's cryptographic key so stolen tokens cannot be replayed.


Overview

What is DPoP?

DPoP (Demonstrating Proof-of-Possession) is an OAuth 2.0 mechanism defined in RFC 9449 that cryptographically binds access tokens to a client-held key pair. Each API request includes a short-lived signed JWT (the DPoP proof) that proves the sender holds the private key — a stolen token alone cannot be replayed by an attacker.

When to Use This Skill

  • Protecting high-value API calls against token theft and replay attacks
  • Meeting security or compliance requirements that mandate sender-constrained tokens
  • Any SPA or Vanilla JS app calling a protected Auth0 API with elevated security needs

When NOT to Use This Skill

  • SSR / server-side environments — DPoP relies on a private key held in the browser; it cannot be safely used server-side (Next.js, Nuxt, etc.)
  • APIs that don't support DPoP — the resource server must be configured to accept DPoP token dialect; Bearer-only APIs will reject DPoP proofs
  • Flows requiring token sharing — DPoP tokens are bound to a single key pair and cannot be forwarded to or reused by another client

Requirements

  • Auth0 tenant with DPoP-capable authorization server
  • API resource server with DPoP token dialect enabled
  • A browser SPA using one of: @auth0/auth0-vue, @auth0/auth0-react, @auth0/auth0-angular, or @auth0/auth0-spa-js
  • HTTPS in production (required by Auth0 for DPoP)

Key Concepts

Concept Description
DPoP Proof A short-lived signed JWT attached to each request proving key possession
DPoP Nonce A server-issued value that must be included in the proof to prevent replay
useDpop: true SDK option that enables automatic DPoP proof generation
createFetcher() SDK helper that returns a fetch-compatible function handling proofs automatically
UseDpopNonceError Error thrown when the server rotates its nonce mid-flight; retry with the new nonce

Step 1: Enable DPoP on Your API

Via Auth0 Dashboard

  1. Go to Applications → APIs
  2. Select the API your SPA calls
  3. Under the Settings tab, confirm the API identifier matches your audience
  4. No additional toggle is needed in the dashboard — DPoP is enabled per-request by the client when the API resource server is configured to accept DPoP tokens

Via Auth0 CLI

# Inspect current resource server settings
auth0 api get "resource-servers" | jq '.[] | select(.identifier == "https://your-api-identifier")'

# Enable DPoP token dialect on the API
auth0 api patch "resource-servers/{API_ID}" \
  --data '{"token_dialect": "access_token_authz"}'

Replace {API_ID} with the ID returned from the GET call above.


Step 2: Configure Your Application

Common pattern across all frameworks

  1. Add useDpop: true to your Auth0 client/provider configuration alongside your audience
  2. Use createFetcher() instead of attaching tokens manually — the SDK handles proof generation, nonce management, and header injection for you
  3. Handle UseDpopNonceError in cases where the server rotates its nonce

Environment variables

Ensure your .env includes the API audience:

# Vite
VITE_AUTH0_DOMAIN=your-tenant.auth0.com
VITE_AUTH0_CLIENT_ID=your-client-id
VITE_AUTH0_AUDIENCE=https://your-api-identifier

Additional Resources

Framework Examples

Complete implementation examples for all supported frameworks:

  • Vue.js
  • React
  • Angular
  • auth0-spa-js (Vanilla JS)

Integration Guide

Error handling and troubleshooting:

  • UseDpopNonceError — nonce rotation handling
  • Common issues

Related Skills

  • auth0-vue - Vue.js Auth0 integration
  • auth0-react - React Auth0 integration
  • auth0-angular - Angular Auth0 integration
  • auth0-spa-js - Vanilla JS / framework-agnostic SPA integration
  • auth0-mfa - Multi-factor authentication

References

  • Auth0 DPoP Documentation
  • RFC 9449 — OAuth 2.0 Demonstrating Proof of Possession
  • auth0-spa-js Releases

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。