Your access token was stolen. Now what: three layers of defence in your own OpenID provider
说明与用途
将访问令牌存储从浏览器迁移到服务器(BFF + Blazor Server),并使用DPoP键绑定和快速吊销,可防止令牌被盗并限制令牌有效期。
问题
Bearer access tokens can be stolen from the browser and used by attackers for the token’s lifetime, exposing sensitive resources.
结果
By moving token handling to the server, using HttpOnly cookies, and binding tokens to keys, the system prevents token theft, limits token replay, and enables rapid revocation. The attack surface is significantly reduced, and detection of anomalous usage becomes more reliable.
工作流
- 1. Replace SPA admin console with a BFF that performs OIDC exchange server‑to‑server.
- 2. Store access tokens in HttpOnly, Secure cookies and in the authentication ticket.
- 3. Use Blazor Server to render UI, eliminating client‑side JavaScript bundles.
- 4. Implement DPoP to bind tokens to a client key, making stolen tokens unusable.
- 5. Enable fast revocation to invalidate tokens immediately when suspicious activity is detected.
证据
Tokens are no longer exposed to the browser, reducing theft risk and limiting token lifetime.
- 记录日期: 2026-09-15T05:30:47.213Z