DPoP (Demonstrating Proof-of-Possession)
Poznają Państwo DPoP — mechanizm kryptograficznie wiążący tokeny dostępu z klientem, zwiększający bezpieczeństwo tokenów i zapobiegający ich wykradzeniu.
DPoP (Demonstrating Proof-of-Possession) to bezpłatna lekcja OAuth2 & OpenID Connect Deep Dive na CoddyKit. To lekcja 2 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej OAuth2 & OpenID Connect Deep Dive, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs OAuth2 & OpenID Connect Deep Dive zawiera 4 lekcji w sumie.
Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.
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:
- It verifies the signature of the DPoP JWT using the public key derived from its
jktclaim. - It ensures the
jktin the DPoP JWT matches thejktstored within the access token itself. - It checks that the
htmandhtuclaims 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.
Często zadawane pytania
Czy lekcja „DPoP (Demonstrating Proof-of-Possession)” jest bezpłatna?
Tak — pełny tekst „DPoP (Demonstrating Proof-of-Possession)” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu OAuth2 & OpenID Connect Deep Dive, przejdź na CoddyKit PRO. Kurs OAuth2 & OpenID Connect Deep Dive zawiera 4 lekcji w sumie.
Co nauczysz się w „DPoP (Demonstrating Proof-of-Possession)”?
Poznają Państwo DPoP — mechanizm kryptograficznie wiążący tokeny dostępu z klientem, zwiększający bezpieczeństwo tokenów i zapobiegający ich wykradzeniu. Ćwiczysz OAuth2 & OpenID Connect Deep Dive z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.
Czy potrzebuję doświadczenia, aby zacząć OAuth2 & OpenID Connect Deep Dive?
Nie wymagamy żadnego doświadczenia. OAuth2 & OpenID Connect Deep Dive w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 2 z 4.
Ile czasu zajmuje lekcja „DPoP (Demonstrating Proof-of-Possession)”?
Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.
Czy mogę pisać i uruchamiać kod w tej lekcji OAuth2 & OpenID Connect Deep Dive?
Tak. Każda lekcja OAuth2 & OpenID Connect Deep Dive zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.
Wszystkie lekcje w tym kursie
- FAPI i API klasy finansowej
- DPoP (Demonstrating Proof-of-Possession)
- Continuous Access Evaluation Protocol (CAEP)
- Pushed Authorization Requests (PAR)