Skip to content

$jwt typing error on AccessToken\Verify #2641

Closed

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!

Activity

  1. bshaffer commented on Dec 16, 2024

    @bshaffer
    Contributor

    Fixed in v2.18.2

    Thanks for reporting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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