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

Uncaught VError: Failed to generate token: secretOrPrivateKey must be an asymmetric key when using ES256 #134

Open
tkafka opened this issue Aug 21, 2023 · 3 comments
Labels

Comments

@tkafka
Copy link

tkafka commented Aug 21, 2023

Hello, I have generated the token for push notifications at Keys section (https://developer.apple.com/account/resources/authkeys/list), enabled Apple Push Notifications service (APNs) there, but when using the generated key (AuthKey_XXXYYYZZZ.p8), I get an error Uncaught VError: Failed to generate token: secretOrPrivateKey must be an asymmetric key when using ES256 from lib/credentials/token/prepare.js:41:13.

I have found that the cause probably is that Apple's generated key is a symmetrical one. Is there a way to convert it to an asymmetrical one, or generate the one that will be accepted?

@parse-github-assistant
Copy link

Thanks for opening this issue!

@tkafka tkafka closed this as completed Aug 22, 2023
@innesngunn
Copy link

I see this issue is closed but I am getting the same error as @tkafka. Any fix or workaround?

@mtrezza mtrezza reopened this Sep 5, 2023
@innesngunn
Copy link

I deleted my node_modules folder and reinstalled from npm. No errors anymore.

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

No branches or pull requests

3 participants