This example uses Node.js + Hono.
We don’t provide a framework-by-framework (or runtime-by-runtime) guide yet.
But you should be able to adapt the same approach to your environment.
Key takeaways:
Authentication happens when handling the HTTP upgrade request.
Browsers don’t let you attach custom headers to a WebSocket upgrade request. Use the protocols parameter to carry the access token, then read it server-side from Sec-WebSocket-Protocol.
WebSocket upgrades are out of scope for DPoP. There’s no RFC-defined way to send and validate a DPoP proof on the upgrade request. In practice, you must skip DPoP proof validation for the upgrade (rejectIfAccessTokenDPoPBound: false). If you need DPoP-grade guarantees on the socket, add an application-level handshake (off-channel).