Laravel AT Protocol Client (alpha & unstable)

Add client assertion support to token refresh

Changed files
+8 -6
src
+8 -6
src/Auth/TokenRefresher.php
··· 13 13 { 14 14 public function __construct( 15 15 protected DPoPClient $dpopClient, 16 - protected ClientMetadataManager $metadata, 16 + protected ClientAssertionManager $clientAssertion, 17 17 ) {} 18 18 19 19 /** ··· 45 45 46 46 $response = $this->dpopClient->request($pdsEndpoint, $tokenUrl, 'POST', $dpopKey) 47 47 ->asForm() 48 - ->post($tokenUrl, [ 49 - 'grant_type' => 'refresh_token', 50 - 'refresh_token' => $refreshToken, 51 - 'client_id' => $this->metadata->getClientId(), 52 - ]); 48 + ->post($tokenUrl, array_merge( 49 + $this->clientAssertion->getAuthParams($pdsEndpoint), 50 + [ 51 + 'grant_type' => 'refresh_token', 52 + 'refresh_token' => $refreshToken, 53 + ] 54 + )); 53 55 54 56 if ($response->failed()) { 55 57 throw new AuthenticationException('Token refresh failed: '.$response->body());