webpush-java icon indicating copy to clipboard operation
webpush-java copied to clipboard

403 MismatchSenderId VAPID

Open Tsyklop opened this issue 6 years ago • 7 comments

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?

Tsyklop avatar Jun 12 '18 12:06 Tsyklop

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?

retrogradeorbit avatar Jul 11 '18 09:07 retrogradeorbit

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.

rudolfbyker avatar Oct 25 '18 10:10 rudolfbyker

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

developergb19 avatar Jun 21 '19 07:06 developergb19

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.

dseljan avatar Sep 12 '19 07:09 dseljan

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.

fatjoem avatar Nov 11 '19 11:11 fatjoem

I wonder if this is the same as https://github.com/web-push-libs/web-push/issues/532.

marco-c avatar Dec 06 '19 19:12 marco-c

@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.

fatjoem avatar Dec 06 '19 20:12 fatjoem