Skip to content

$jwt typing error on AccessToken\Verify #2641

@gaea44

Description

@gaea44

Environment details

  • OS: Linux Mint 21.3
  • PHP version: 8.3.14
  • Package name and version: google/apiclient v2.18.1

Steps to reproduce

  1. instanciate a new Google Client with a $jwt oject
$client = new Google\Client();
$jwt = new Firebase\JWT\JWT();
$jwt::$leeway = 50;

$client->setConfig('jwt', $jwt);
  1. Call VerifyIdToken with the client
$client->verifyIdToken($someApiToken);
  1. A 500 error is thrown
    Google\\AccessToken\\Verify::__construct(): Argument #3 ($jwt) must be of type ?string, Firebase\\JWT\\JWT given, called in \/home\/bbousba\/dev\/provider-api\/vendor\/google\/apiclient\/src\/Client.php on line 848

The error is due to the newly ?string typing in src/AccessToken/Verify.php l.72 where it should be ?Firebase\JWT\JWT

public function __construct(
    ClientInterface $http = null,
    CacheItemPoolInterface $cache = null,
    ?string $jwt = null
)

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions