You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 20, 2025. It is now read-only.
Repository navigation
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
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.
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.
Reacted by Irunika Weeraratne, Abhishek Sira Chandrashekar, Tommaso Scarlatti and Bogon Park
The kid is matching a certificate that isn't provided via the urls in this library, but after looking for other public auth certs google may have, I found the firebase-admin library, which had this url in the code: https://www.googleapis.com/robot/v1/metadata/x509/[email protected]
However, this library doesn't include those certificates when figuring out which certificate to work with.
@danielbankhead can you explain this? There's this bizarre crossover with google auth and firebase... the library is called googleSignIn in android, this is incredibly confusing and has blown away a lot of my time
Reacted by Daniel Bankhead, Irunika Weeraratne and Bogon Park
My workaround looks like this now... nasty but it works.
import{OAuth2Client}from'google-auth-library';importfirebasefrom'firebase-admin';constfirebaseClient=firebase.initializeApp({credential: {// firebase credential key});// resolve a token to the user email'sexportasyncfunctionderiveEmailFromGoogleToken(token: string): Promise<string>{constclient=newOAuth2Client('CLIENT_ID_1');try{constticket=awaitclient.verifyIdToken({idToken: token,audience: ['281074435194-iacdh6vqefvlkg5d39612ovu8qerhj9i.apps.googleusercontent.com','281074435194-fl6i1orvoe8i68u49emmfag840tejtba.apps.googleusercontent.com',],});constresult=ticket.getPayload();returnresult.email;}catch(error){// google auth library failed, move on}try{constresult=awaitfirebaseClient.auth().verifyIdToken(token);returnresult.email;}catch(error){// move on}thrownewError('no match for google sign in.');}
@jpike88 apologies for the delay; we're working to improve the integration between this library and Firebase - I should have some updates on this and other related issues shortly.
@ByBogon, no problem; we've completed integration preparation in this library - the Firebase team should have some public updates shortly (within a month or so)
@ByBogon sure thing, Firebase requires custom transporter interface and previously we didn’t have a flexible, uniform way to customize it until this larger refactor:
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.
Activity
jpike88 commentedon May 28, 2022
Found the root of the problem
The kid is matching a certificate that isn't provided via the urls in this library, but after looking for other public auth certs google may have, I found the firebase-admin library, which had this url in the code:
https://www.googleapis.com/robot/v1/metadata/x509/[email protected]However, this library doesn't include those certificates when figuring out which certificate to work with.
@danielbankhead can you explain this? There's this bizarre crossover with google auth and firebase... the library is called googleSignIn in android, this is incredibly confusing and has blown away a lot of my time
jpike88 commentedon May 28, 2022
My workaround looks like this now... nasty but it works.
summer-ji-eng commentedon May 31, 2022
@danielbankhead could you take a look at this issue? Many thanks
build: make ci testing conditional on engines field in package.json, …
danielbankhead commentedon Jan 12, 2023
@jpike88 apologies for the delay; we're working to improve the integration between this library and Firebase - I should have some updates on this and other related issues shortly.
himanshu-incedo commentedon Jul 31, 2023
Sorry for asking again, but any progress? The issue still persists
danielbankhead commentedon Jul 31, 2023
@himanshu-incedo Hey! As of recent weeks, we're actively working on it internally with the Firebase team.
danielbankhead commentedon Sep 27, 2023
A quick update on this ticket: We're still actively working on it, more updates to follow.
ByBogon commentedon Jan 4, 2024
Sorry for asking again but is there any updates?
danielbankhead commentedon Jan 23, 2024
@ByBogon, no problem; we've completed integration preparation in this library - the Firebase team should have some public updates shortly (within a month or so)
ByBogon commentedon Jan 24, 2024
@danielbankhead
Could you give me more details about integration preparation if possible?
danielbankhead commentedon Jan 24, 2024
@ByBogon sure thing, Firebase requires custom transporter interface and previously we didn’t have a flexible, uniform way to customize it until this larger refactor:
AuthClientOptions #1663ByBogon commentedon Jan 26, 2024
@danielbankhead Thank you for sharing! can't wait to update its version.
danielbankhead commentedon Feb 28, 2024
Current WIP to resolve this: