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

Local Development - Failed to Sign Service Account Credential #23

Open
pyke-jason opened this issue Jul 28, 2024 · 1 comment
Open

Local Development - Failed to Sign Service Account Credential #23

pyke-jason opened this issue Jul 28, 2024 · 1 comment

Comments

@pyke-jason
Copy link

pyke-jason commented Jul 28, 2024

Description

Exception raised on call to crypto.subtle.sign in ServiceAccountCredential.sign. Attempting to call createSessionCookie and running the project in local development with a service account. Running on Cloudflare Pages works fine.

Error Message

⨯ Error [TypeError]: Failed to execute 'sign' on 'SubtleCrypto': 3rd argument is not instance of ArrayBuffer, Buffer, TypedArray, or DataView.
   at codedTypeError (node:internal/crypto/webidl:45:15)
   at makeException (node:internal/crypto/webidl:54:10)
   at converters.BufferSource (node:internal/crypto/webidl:218:11)
   at SubtleCrypto.sign (node:internal/crypto/webcrypto:848:28)
   at ServiceAccountCredential.sign (webpack-internal:///(rsc)/../../node_modules/firebase-auth-cloudflare-workers/dist/module/credential.js:76:53)
   ...

Details

Strange error. I've verified that the 3rd argument (buf) passed to the sign function is indeed an ArrayBuffer.

Environment

  • Node.js version: Tested v18.17.1, v18.20.4, v20.16.0
  • firebase-auth-cloudflare-workers version: 2.0.4

Any guidance would be greatly appreciated. Thanks!

@Code-Hex
Copy link
Owner

@pyke-jason I'm sorry for the late response 🙇
Could you solve this issue now?

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