···
# atProto OAuth Authentication
3
-
This package implements third-party OAuth authentication for Coves, validating JWT Bearer tokens from mobile apps and other atProto clients.
3
+
This package implements third-party OAuth authentication for Coves, validating DPoP-bound access tokens from mobile apps and other atProto clients.
···
20
-
Authorization: Bearer <jwt>
20
+
Authorization: DPoP <access_token>
24
-
Extract JWT โ Parse Claims โ Verify Signature (via JWKS)
25
+
Extract JWT โ Parse Claims โ Verify Signature (via JWKS) โ Verify DPoP Proof
Inject DID into Context โ Call Handler
···
curl -X POST https://coves.social/xrpc/social.coves.community.create \
74
-
-H "Authorization: Bearer eyJhbGc..." \
75
+
-H "Authorization: DPoP eyJhbGc..." \
76
+
-H "DPoP: eyJhbGc..." \
-H "Content-Type: application/json" \
-d '{"name":"Gaming","hostedByDid":"did:plc:..."}'
···
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
144
-
โ 1. Authorization: Bearer <token> โ
146
+
โ 1. Authorization: DPoP <token> โ
โ DPoP: <proof-jwt> โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ>โ
···
# Create a test JWT (use jwt.io or a tool)
export AUTH_SKIP_VERIFY=true
curl -X POST http://localhost:8081/xrpc/social.coves.community.create \
279
-
-H "Authorization: Bearer <test-jwt>" \
281
+
-H "Authorization: DPoP <test-jwt>" \
282
+
-H "DPoP: <test-dpop-proof>" \
-d '{"name":"Test","hostedByDid":"did:plc:test"}'
···
# Use a real JWT from a PDS
export AUTH_SKIP_VERIFY=false
curl -X POST http://localhost:8081/xrpc/social.coves.community.create \
288
-
-H "Authorization: Bearer <real-jwt>" \
291
+
-H "Authorization: DPoP <real-jwt>" \
292
+
-H "DPoP: <real-dpop-proof>" \
-d '{"name":"Test","hostedByDid":"did:plc:test"}'
···
314
-
1. **Missing Authorization header** โ Add `Authorization: Bearer <token>`
318
+
1. **Missing Authorization header** โ Add `Authorization: DPoP <token>` and `DPoP: <proof>`
2. **Token expired** โ Get a new token from PDS
3. **Invalid signature** โ Ensure token is from a valid PDS
4. **JWKS fetch fails** โ Check PDS availability and network connectivity