web-push-libs / web-push

Web Push library for Node.js
Other
3.21k stars 306 forks source link

the key in the authorization header does not correspond to the sender ID used to subscribe this user. Please ensure you are using the correct sender ID and server Key from the Firebase console #684

Open JhonCordoba opened 2 years ago

JhonCordoba commented 2 years ago

Operating System: Linux Node Version: 14.17.3 web-push Version: 3.4.5

Please select any browsers that you are experiencing problems with:

Problem

the key in the authorization header does not correspond to the sender ID used to subscribe this user. Please ensure you are using the correct sender ID and server Key from the Firebase console. i am using the method webpush.setGCMAPIKey(process.env.FCM_API_KEY as string) to set the server key; but how can i set the sender ID? how can i set the project with firebase cloud messaging?

Please explain what behaviour you are seeing. when i try to send a notification i get the message: the key in the authorization header does not correspond to the sender ID used to subscribe this user. Please ensure you are using the correct sender ID and server Key from the Firebase console

Expected

i expect the web push library send the request to FCM and i get the notification on my browser.

Please explain what you expected to happen

Features Used

Example / Reproduce Case

Please provide a code sample that reproduces the issue. If there is a repository that reproduces the issue please put the link here.

Other

Please put any remaining notes here.

naveenreddy3 commented 2 years ago

Hi @JhonCordoba, i am also facing this issue any solution?

JhonCordoba commented 2 years ago

Hey man, no, at end i use the Service Worker API, without additional libraries

akash-agr commented 2 years ago

Hey man, no, at end i use the Service Worker API, without additional libraries

Hey, I am also facing same problem. Can you please how to use Service Worker API without any additional library? I was using web-push library, it was working fine until a month ago, now it has stopped working.

Pomax commented 1 year ago

One thing I ran into was that I had forgotten that I'd generated a new set of keys, and was using the old public key on the client-side, but the new public/private keys on the server, so for anyone who runs into that: triple check that you're using the correct keys everywhere.