When you build apps that connect to Google services like Gmail or Drive, you use OAuth tokens for authentication. Google just changed how these tokens work at a fundamental level with DPoP (Demonstrating Proof-of-Possession). This matters whether you’re building browser apps, mobile apps, or AI agents that need API access.
Why DPoP changes the security game
Traditional OAuth tokens work like concert tickets—whoever holds them gets in. If malware steals your token (which happens constantly with tools like RedLine), attackers can impersonate your app indefinitely. DPoP fixes this by cryptographically binding tokens to your app’s unique keypair.
Think of it like adding a fingerprint requirement to your ticket:
- Before: Stolen refresh token = Unlimited access for attackers
- After: Stolen token + No private key = Useless to attackers
Google implemented this only for refresh tokens (not access tokens) because:
| Token Type | Lifetime | DPoP Protected? | Why |
|---|---|---|---|
| Refresh | Months/years | ✅ | High-value target |
| Access | ~1 hour | ❌ | Performance impact too high |
Tip
When you update your OAuth flow, focus on securing refresh tokens first. Access tokens expire quickly and aren’t worth the cryptographic overhead.
What you need to change in your code
DPoP requires four technical adjustments to your authentication flow:
- Key generation: Your app must create and manage an asymmetric keypair (like ES256)
- Proof construction: Each token request includes a JWT proving key ownership
- Header management: Exact
DPoPheader formatting per RFC 9449 - Timestamp/nonce handling: Strict validation to prevent replay attacks
Here’s the critical path for a DPoP-protected refresh:
graph TD
A[Generate keypair] --> B[Include public key in token request]
B --> C[Google binds token to key]
C --> D[App signs future requests with private key]
Important
Browser apps face extra complexity. Google recommends Backend-for-Frontend (BFF) patterns to securely manage keys—never store them in client-side JavaScript.
When to adopt DPoP (and when to wait)
Adopt now if you:
- Handle sensitive user data (healthcare, finance, enterprise)
- Build long-lived services where token theft would be catastrophic
- Use Google Workspace Context-Aware Access
Wait if you:
- Only need short-lived access tokens (under an hour)
- Run high-QPS APIs where crypto overhead hurts performance
- Depend on multi-agent workflows (more below)
The multi-agent problem
DPoP creates challenges for AI agent chains where:
- Agent A gets a token
- Delegates to Agent B
- Agent B needs to call an API
Since Agent B can’t sign with Agent A’s key, you have two options:
- Token Exchange: Use Google Cloud STS to issue new tokens (adds latency)
- Session Sharing: Risky key sharing that defeats DPoP’s purpose

Frequently asked questions
Does DPoP replace OAuth 2.0?
No—it extends it. You’ll still use standard OAuth flows, just with added cryptographic proofs for refresh tokens.
What happens if I lose my private key?
You’ll need to re-authenticate to get new tokens. Treat keys like passwords—store them securely using your platform’s key management system.
The big picture
DPoP is part of a broader shift toward “sender-constrained” credentials. For web sessions, Google’s developing Device Bound Session Credentials (DBSC) to bind cookies to hardware. Together, they close major theft vectors:
| Attack Vector | Old Protection | New Protection |
|---|---|---|
| Token theft | Short expiry | DPoP |
| Cookie theft | SameSite | DBSC |
This won’t affect most beginners immediately, but as you build more advanced apps—especially with AI agents—these patterns will become standard. Implement them early in high-risk scenarios, and you’ll avoid painful refactors later.
Want to try all of this hands-on? Start with the free Vibe Coding 101 course.
Source
Based on Google’s announcement, “Announcing DPoP Support for Google OAuth: Securing Refresh Tokens”. Written for people learning to build with these tools.