googleapis / google-oauth-java-client

Google OAuth Client Library for Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with IdTokenVerifier cache

actran3 opened this issue · comments

I filed a ticket with Google Support recently with an issue regarding the CacheLoader in IdTokenVerifier. They there might be issues where a request timeout could result in caching an empty Map instead of a null result.

this.publicKeyCache =
CacheBuilder.newBuilder()
.expireAfterWrite(1, TimeUnit.HOURS)
.build(new PublicKeyLoader(transport));

What I see in my stack is the following

ERROR_MSG=Could not find PublicKey for provided keyId: xxxxxx][STACK=com.google.api.client.auth.openidconnect.IdTokenVerifier$VerificationException: Could not find PublicKey for provided keyId:xxxxxx|	at com.google.api.client.auth.openidconnect.IdTokenVerifier.verifySignature(IdTokenVerifier.java:280)

This error persists for about an hour, before resolving itself. Which is in line with the expiration of the cache.