webpush-java
webpush-java copied to clipboard
403 MismatchSenderId VAPID
I try send notification from jar in IDEA.
Keys generated with same jar.
My arguments command:
send-notification
--subscription="{'endpoint': 'https://fcm.googleapis.com/fcm/send/f2tFGlQREiw:APA91bGKY0TakQ92UOPNlRe3_DiJ2CT0bC-m98CINcBRuKqvjBhkaO9im01T9ZLlOJeVRCXV57zSk1qgLTB5Wz6oAjrJ3Y19G4vQrWgKqsvwKeRAiCJHlmac_aJrF_tWlMgwyqfRwOHA', 'expirationTime': null, 'keys': {'p256dh': 'BKBQF2VLYXmpQ3sEcgj8wjUJjfhgz5GW7PyTvN2FB1MlAMSLN2bgwOqe9GkSbmoiRedlpgfp6CihUzGhp5DtCkM','auth': 'BJO4i2ltwyyV8ekNpaW4hQ'}}"
--publicKey="BIqmcv0cVhdGJMjBa16jAhMh-eRfiG5-g14WkSj_62pL7zSKJP1KDoPOGW2wN-BIo6VNQsxZKr1VrYXO66If2hc="
--privateKey="RauHMIAXL8UKqrtn1EvWUWeO2No62P-XTo56yM59lDI="
--payload="Hello, lovely world"
subscription
I get from your UI from js-subscription-json element.
What wrong?
I'm not using this library, but have been implementing webpush. I got the same error which led me to this ticket. Everything worked for firefox, but chrome fcm push server kept giving me this error. I had to add "gcm_sender_id" to my manifest.json, and then server pushes stopped giving this error. Weird thing is then I removed the gcm_sender_id, and the pushes continued to work. Go figure!
My general experience implementing webpush from scratch in both firefox and chrome is that firefox works as per the specs and works very well. And chrome is a constant series of bugs, errors, corner cases, poor documentation and attempts to get you to use firebase. (I'm certainly not going to bundle 700K of unknown closed source Javascript, megabytes of closed source java server side code, agree to the restrictive firebase T&Cs, and hand all my users over to google to be tracked for just a simple web push. There is meant to be this thing called "the open web")
Try your app on firefox. Does it work? If it still doesn't work on Chrome, try adding a gcm_sender_id to your manifest.json. Does that resolve this error?
Where does this manifest.json file go, and where do I get a sender ID? I'm developing with Web Push PHP, and everything works with Firefox, but not in Chrome.
Is there any solution for this problem found? I recieve the same error for different notifications. I dont use GCM. Could the problem be as a result of the VAPID key or subscribers auth_token & public_key errors
I can confirm sending push notifications doesn't work for FCM using VAPID. Getting 403 each time. I'm on latest Chrome version. I've just tried to send a notification using subscription in Mozilla, everything works as expected.
EDIT: I have managed to send a notification to Chrome! It turns out, if you send an empty payload, you get a status forbidden for some reason.
WebPush worked well for Google Chrome in our project. A couple of weeks ago Google Chrome WebPush service started returning the 403 error code. It seems to happen more regularly now.
This is not a documented error code in WebPush protocol, hence we don't know how to handle it.
I wonder if this is the same as https://github.com/web-push-libs/web-push/issues/532.
@marco-c chances are very high that this is the same issue. Unfortunately I don't have the time right now to fully understand the root cause or fix.