0Pricing
OAuth2 & OpenID Connect Deep Dive · บทเรียน

DPoP (การพิสูจน์การครอบครอง)

ทำความเข้าใจ DPoP กลไกที่ผูกโทเค็นเข้าถึงเข้ากับไคลเอ็นต์ด้วยการเข้ารหัส ช่วยเพิ่มความปลอดภัยของโทเค็นและป้องกันการลักลอบนำโทเค็นออกไป

DPoP (การพิสูจน์การครอบครอง) เป็นบทเรียน OAuth2 & OpenID Connect Deep Dive ฟรีบน CoddyKit นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน OAuth2 & OpenID Connect Deep Dive และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส OAuth2 & OpenID Connect Deep Dive มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

What is DPoP?

Welcome! Today we'll explore DPoP, which stands for Demonstrating Proof-of-Possession. It's a crucial security enhancement for OAuth2 and OpenID Connect.

DPoP helps prevent a major security risk: stolen access tokens. It ensures that only the legitimate client (the app) can use an access token.

The Token Theft Problem

Imagine an attacker steals an access token. Without DPoP, they could use this token to access your protected resources, impersonating the legitimate client.

This 'token exfiltration' is a significant vulnerability. Standard bearer tokens don't inherently prevent this because anyone who 'bears' (possesses) the token can use it.

How DPoP Solves It

DPoP cryptographically binds an access token to a specific client's private key. Think of it like a digital signature that only the rightful client can produce.

Here's the core idea:

  • The client generates a unique key pair.
  • The public key is linked to the access token.
  • The client 'proves possession' of the private key with every request.

Client's Secret Key Pair

The process starts with the client application generating an asymmetric cryptographic key pair. This means it creates both a private key and a public key.

  • The private key is kept secret by the client.
  • The public key can be shared without compromising security.

This key pair is unique to the client session or instance.

Requesting a DPoP Token

When the client requests an access token from the Authorization Server, it includes a special header called DPoP in the request.

This DPoP header contains a JSON Web Token (JWT) signed by the client's private key. This JWT includes a hash of the client's public key.

The DPoP JWT & jkt Claim

The JWT in the DPoP header is the 'proof of possession'. It contains several claims:

  • jkt: The JSON Web Key Thumbprint of the client's public key.
  • htm: The HTTP method of the request (e.g., GET, POST).
  • htu: The HTTP URL of the request.
  • iat: Issued At time, preventing replay.

The Authorization Server validates this JWT and binds the jkt to the issued access token.

Using a DPoP-Bound Token

Once the client receives a DPoP-bound access token, it uses it to access protected resources on the Resource Server.

With every request to the Resource Server, the client must again send a new DPoP header containing a fresh JWT, signed by its private key, matching the current request's htm and htu.

Resource Server Validation

The Resource Server performs critical checks:

  1. It verifies the signature of the DPoP JWT using the public key derived from its jkt claim.
  2. It ensures the jkt in the DPoP JWT matches the jkt stored within the access token itself.
  3. It checks that the htm and htu claims in the DPoP JWT match the actual HTTP request.

If any check fails, access is denied. This ensures only the client possessing the private key can use the token.

DPoP vs. Mutual TLS (mTLS)

You might wonder about Mutual TLS (mTLS). Both DPoP and mTLS bind tokens to a client, but they operate at different layers:

  • mTLS: Binds at the TLS (transport) layer using client certificates.
  • DPoP: Binds at the application layer using cryptographic proofs in HTTP headers.

DPoP is often more flexible and easier to implement for a wider range of client types (especially public clients like mobile apps) compared to mTLS.

Test Your DPoP Knowledge

Which of the following are key benefits of using DPoP in OAuth2/OIDC implementations?

DPoP: A Stronger Bind

Congratulations! You've learned about DPoP, a powerful security mechanism.

DPoP enhances OAuth2 and OIDC by cryptographically binding access tokens to the client's private key, effectively preventing token exfiltration and making stolen tokens unusable by attackers.

This 'proof of possession' significantly strengthens the security posture of your applications by ensuring only the legitimate client can use its access tokens.

คำถามที่พบบ่อย

บทเรียน “DPoP (การพิสูจน์การครอบครอง)” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “DPoP (การพิสูจน์การครอบครอง)” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส OAuth2 & OpenID Connect Deep Dive ให้อัปเกรดเป็น CoddyKit PRO คอร์ส OAuth2 & OpenID Connect Deep Dive มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “DPoP (การพิสูจน์การครอบครอง)”

ทำความเข้าใจ DPoP กลไกที่ผูกโทเค็นเข้าถึงเข้ากับไคลเอ็นต์ด้วยการเข้ารหัส ช่วยเพิ่มความปลอดภัยของโทเค็นและป้องกันการลักลอบนำโทเค็นออกไป คุณปฏิบัติ OAuth2 & OpenID Connect Deep Dive ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน OAuth2 & OpenID Connect Deep Dive หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน OAuth2 & OpenID Connect Deep Dive บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน

บทเรียน “DPoP (การพิสูจน์การครอบครอง)” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน OAuth2 & OpenID Connect Deep Dive นี้ได้ไหม

ได้ บทเรียน OAuth2 & OpenID Connect Deep Dive ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. FAPI และ API ระดับการเงิน
  2. DPoP (การพิสูจน์การครอบครอง)
  3. โพรโทคอลประเมินการเข้าถึงอย่างต่อเนื่อง (CAEP)
  4. คำขอการมอบสิทธิ์แบบผลัก (PAR)
← กลับไปที่ OAuth2 & OpenID Connect Deep Dive