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

verifyIdToken without a service account #23

Open
gkiely opened this issue Dec 13, 2023 · 1 comment
Open

verifyIdToken without a service account #23

gkiely opened this issue Dec 13, 2023 · 1 comment

Comments

@gkiely
Copy link

gkiely commented Dec 13, 2023

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
Copy link
Member

koistya commented Dec 20, 2023

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

/**
* Verifies the authenticity of an ID token issued by Google.
*
* @example
* const token = await verifyIdToken({
* idToken: "eyJhbGciOiJSUzI1NiIsImtpZC...yXQ"
* projectId: "my-project"
* waitUntil: ctx.waitUntil,
* });
*
* @example
* const token = await verifyIdToken({
* idToken: "eyJhbGciOiJSUzI1NiIsImtpZC...yXQ"
* waitUntil: ctx.waitUntil,
* env: { GOOGLE_CLOUD_PROJECT: "my-project" }
* });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants