Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
diegomarquezp opened this issue Sep 30, 2022 · 0 comments · Fixed by #953
Labels
type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@diegomarquezp
Copy link
Contributor

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());
    }
@diegomarquezp diegomarquezp added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
1 participant