You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method getAccessToken (https://github.com/patrickbussmann/oauth2-apple/blob/main/src/Provider/Apple.php#L236) does not use the $options override when creating the JWT token. The practical example for this is that I need to set a specific client_id for the request. The result now is that I have a client_id in the request payload that matches, but the sub (client_id) in the payload of the client_secret JWT doesn't match.
public function getAccessToken($grant, array $options = [])
{
$configuration = $this->getConfiguration();
$time = new \DateTimeImmutable();
$time = $time->setTime($time->format('H'), $time->format('i'), $time->format('s'));
$expiresAt = $time->modify('+1 Hour');
$expiresAt = $expiresAt->setTime($expiresAt->format('H'), $expiresAt->format('i'), $expiresAt->format('s'));
$token = $configuration->builder()
->issuedBy($this->teamId)
->permittedFor('https://appleid.apple.com')
->issuedAt($time)
->expiresAt($expiresAt)
->relatedTo($this->clientId) // THIS LINE SHOULD USE CLIENT_ID FROM $OPTIONS IF PRESENT
->withHeader('alg', 'ES256')
->withHeader('kid', $this->keyFileId)
->getToken($configuration->signer(), $configuration->signingKey());
$options += [
'client_secret' => $token->toString()
];
return parent::getAccessToken($grant, $options);
}
The text was updated successfully, but these errors were encountered:
The method getAccessToken (https://github.com/patrickbussmann/oauth2-apple/blob/main/src/Provider/Apple.php#L236) does not use the $options override when creating the JWT token. The practical example for this is that I need to set a specific client_id for the request. The result now is that I have a client_id in the request payload that matches, but the sub (client_id) in the payload of the client_secret JWT doesn't match.
The text was updated successfully, but these errors were encountered: