googleapis / google-oauth-java-client

Google OAuth Client Library for Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IdTokenVerifierTest.testVerifyServiceAccountRs256Token:331 » IO Could not find public key for provided keyId [KEY]

diegomarquezp opened this issue · comments

New PRs are failing due to this failing test. Local attempts end up in the same result.

The faulty code is in com.google.api.client.auth.openidconnect.IdTokenVerifier:299:

try {
      String certificateLocation = getCertificateLocation(idToken.getHeader());
      publicKeyToUse = publicKeyCache.get(certificateLocation).get(idToken.getHeader().getKeyId()); // returns null
    } catch (ExecutionException | UncheckedExecutionException e) {
      throw new IOException(
          "Error fetching public key from certificate location " + certificatesLocation, e);
    }

  if (publicKeyToUse == null) {
      throw new IOException(
          "Could not find public key for provided keyId: " + idToken.getHeader().getKeyId());
    }