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

Question about configuration #6

Closed
timmushen opened this issue Oct 29, 2022 · 4 comments
Closed

Question about configuration #6

timmushen opened this issue Oct 29, 2022 · 4 comments

Comments

@timmushen
Copy link

Hi, I have a question relating to configuration.

I'm able to authenticate with an express firebase-admin script. When I try on Cloudflare I receive the following error:

"err": {
"code": "auth/argument-error",
"message": "Error fetching public keys for Google certs: TypeError: Cannot read properties of undefined (reading 'get')"
}

Thank you for making this! I'm very excited to use it.

@Code-Hex
Copy link
Owner

@timmushen Hi! Thanks for asking your question!

But, I cannot understand why this is happened the error from only you provided information. Could you share me your wrangler.toml?

By the way, I appreciate you with sponsoring me! Thank you so much!

@timmushen
Copy link
Author

timmushen commented Oct 30, 2022

@Code-Hex My pleasure! Thank you for your contributions to the community.

Here's my wrangler.toml. I believe it's an issue with the PUBLIC_JWT_CACHE_KEY... I'm not exactly sure what should go here.

name="hono-minimal"
main="src/index.ts"
compatibility_date = "2022-10-12"
[vars]
PUBLIC_JWK_CACHE_KEY = "https://www.googleapis.com/robot/v1/metadata/x509/*omitted service account email*"
PROJECT_ID = "salonspasites"
kv_namespaces =[{ binding = "salonspaauth", id = "a88b99020b8b44caa75155ba38ee6b66" }]

@Code-Hex
Copy link
Owner

Code-Hex commented Nov 3, 2022

@timmushen I'm sorry for the delay.
Yes, This PUBLIC_JWK_CACHE_KEY means the name of the cache (use Cloudflare KV by default) key.

This package has the ability to automatically retrieve the jwk hosted by Google, and save the jwk file to the cache. This key name is used for that.

This is example for wrangler.toml.

# Specify cache key to store and get public jwk.
PUBLIC_JWK_CACHE_KEY = "public-jwk-cache-key"

@timmushen
Copy link
Author

That did it! Thank you so much for your help.

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