Laravel AT Protocol Client (alpha & unstable)
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix DPoP JWK format to extract key from JWKS wrapper

+10 -4
+10 -4
src/Data/DPoPKey.php
··· 15 15 16 16 public function getPublicJwk(): array 17 17 { 18 - $jwk = $this->publicKey->toString('JWK'); 18 + $jwks = json_decode($this->publicKey->toString('JWK'), true); 19 + 20 + // phpseclib returns JWKS format {"keys":[...]}, extract the first key 21 + $jwk = $jwks['keys'][0] ?? $jwks; 19 22 20 23 return array_merge( 21 - json_decode($jwk, true), 24 + $jwk, 22 25 [ 23 26 'alg' => 'ES256', 24 27 'use' => 'sig', ··· 29 32 30 33 public function getPrivateJwk(): array 31 34 { 32 - $jwk = $this->privateKey->toString('JWK'); 35 + $jwks = json_decode($this->privateKey->toString('JWK'), true); 36 + 37 + // phpseclib returns JWKS format {"keys":[...]}, extract the first key 38 + $jwk = $jwks['keys'][0] ?? $jwks; 33 39 34 40 return array_merge( 35 - json_decode($jwk, true), 41 + $jwk, 36 42 [ 37 43 'alg' => 'ES256', 38 44 'use' => 'sig',