kriasoft / web-auth-library

Authentication library for the browser environment using Web Crypto API
https://developer.mozilla.org/docs/Web/API/Web_Crypto_API
MIT License
102 stars 9 forks source link

verifyIdToken without a service account #23

Open gkiely opened 11 months ago

gkiely commented 11 months ago

I would like the ability to verify an idToken without the use of a service account, this can be achieved using google-auth-library. https://developers.google.com/identity/gsi/web/guides/verify-google-id-token#using-a-google-api-client-library

When attempting this I'm getting the following error:

Server error: Public key "..." not found.
koistya commented 11 months ago

@gkiely did you provide projectId of the GCP project that issued the ID token?

https://github.com/kriasoft/web-auth-library/blob/42a722e4cedc09ea2a86f92fe5aed73b19e5de94/google/idToken.ts#L135-L150