PKCE (Proof Key for Code Exchange)
PKCE (Proof Key for Code Exchange) とは何ですか?
PKCE (Proof Key for Code Exchange)An OAuth 2.0 extension (RFC 7636) that binds an authorization-code redemption to a one-time secret created by the client, neutralizing authorization-code interception attacks on public and confidential clients alike.
PKCE (Proof Key for Code Exchange, RFC 7636) is an OAuth 2.0 extension originally introduced to protect public clients — mobile apps, single-page apps, native CLIs — from authorization-code interception attacks, and now recommended for every OAuth 2.0 client by the OAuth 2.1 BCPs. The flow adds two parameters. At the authorization request, the client generates a high-entropy `code_verifier`, hashes it (SHA-256) into a `code_challenge`, and sends the challenge to the authorization server. When the client later exchanges the returned authorization code for tokens, it sends the original `code_verifier`; the server hashes it and rejects the exchange unless the result matches the challenge it remembered. Because the verifier never leaves the client until the token exchange, an attacker who intercepts the redirect URL (via a registered scheme on a malicious app, a referrer leak, or a misconfigured intermediate) cannot redeem the code. Modern guidance (OAuth 2.1, FAPI, Entra ID, Auth0, Okta) recommends PKCE for confidential clients too, and many IdPs now enforce it.
● 例
- 01
A React SPA initiates the OAuth code flow with a SHA-256 `code_challenge`, then exchanges the returned code plus `code_verifier` for tokens from the IdP.
- 02
An IdP rejects an authorization-code grant from a public client that arrived without a matching PKCE verifier, treating it as a sign of interception.
● よくある質問
PKCE (Proof Key for Code Exchange) とは何ですか?
An OAuth 2.0 extension (RFC 7636) that binds an authorization-code redemption to a one-time secret created by the client, neutralizing authorization-code interception attacks on public and confidential clients alike. サイバーセキュリティの ID とアクセス カテゴリに属します。
PKCE (Proof Key for Code Exchange) とはどういう意味ですか?
An OAuth 2.0 extension (RFC 7636) that binds an authorization-code redemption to a one-time secret created by the client, neutralizing authorization-code interception attacks on public and confidential clients alike.
PKCE (Proof Key for Code Exchange) はどのように機能しますか?
PKCE (Proof Key for Code Exchange, RFC 7636) is an OAuth 2.0 extension originally introduced to protect public clients — mobile apps, single-page apps, native CLIs — from authorization-code interception attacks, and now recommended for every OAuth 2.0 client by the OAuth 2.1 BCPs. The flow adds two parameters. At the authorization request, the client generates a high-entropy `code_verifier`, hashes it (SHA-256) into a `code_challenge`, and sends the challenge to the authorization server. When the client later exchanges the returned authorization code for tokens, it sends the original `code_verifier`; the server hashes it and rejects the exchange unless the result matches the challenge it remembered. Because the verifier never leaves the client until the token exchange, an attacker who intercepts the redirect URL (via a registered scheme on a malicious app, a referrer leak, or a misconfigured intermediate) cannot redeem the code. Modern guidance (OAuth 2.1, FAPI, Entra ID, Auth0, Okta) recommends PKCE for confidential clients too, and many IdPs now enforce it.
PKCE (Proof Key for Code Exchange) からどのように防御しますか?
PKCE (Proof Key for Code Exchange) に対する防御は通常、上記の定義で述べたとおり、技術的統制と運用上の実践を組み合わせます。
PKCE (Proof Key for Code Exchange) の別名は何ですか?
一般的な別名: RFC 7636, Proof Key for Code Exchange。
● 関連用語
- identity-access№ 839
OAuth 2.0
リソース所有者が資格情報を共有せずに、サードパーティ製アプリへ API に対する制限付き・スコープ付きのアクセスを委譲できる、オープンな認可フレームワーク。
- identity-access№ 852
OpenID Connect (OIDC)
OAuth 2.0 上に構築された ID レイヤーで、クライアントが署名付き ID トークンを通じて利用者の身元を検証し、基本プロフィールを取得できるようにする。
- identity-access№ 090
認可
認証済みの ID が、どのリソースに対してどの操作を、どの条件下で実行できるかを判断するプロセス。
- identity-access№ 642
JWT(JSON Web Token)
署名付き JSON クレームを運ぶ、コンパクトで URL セーフなトークン形式(RFC 7519)。アクセストークン、ID トークン、セッションコンテナとして広く使われる。
- identity-access№ 089
認証
アクセス権を与える前に、利用者・端末・サービスが本当に名乗っているとおりの実体であることを確認するプロセス。
- identity-access№ 395
DPoP (Demonstrating Proof of Possession)
An OAuth 2.0 extension (RFC 9449) that binds access tokens to a per-client key pair, so a stolen bearer token cannot be replayed by an attacker without also stealing the private signing key.