Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

No pem found for envelope (wrong 'kid' property match) #1418

@jpike88

Description

@jpike88

if (!Object.prototype.hasOwnProperty.call(certs, envelope.kid)) {

My code looks like this:

const client = new OAuth2Client(
		'CLIENT_ID_1'
	);
	
const ticket = await client.verifyIdToken({
			idToken: token,
			audience: [
				'CLIENT_ID_1',
				'CLIENT_ID_2',
			],
		});
		const payload = ticket.getPayload();
		return payload.email;

It works well for my iOS and web Google Sign in implementations.
For the android one, it's failing, with error:

No pem found for envelope: {"alg":"RS256","kid":"6f8e1cb15641463c6df0f33394b03c92fcc889ac","typ":"JWT"}

The payload and envelope are separated correctly, it seems there is just the wrong 'kid' matching going on with the certs fetched from getFederatedSignonCertsAsync. How can I fix this?

And this is unlikely related to caching, as I had the same identical problem on local emulator, as well as a physical device, also have the same problem testing in the cloud. All freshly signed into a Google account without ever being signed into it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions