web-push-libs / webpush-java

Web Push library for Java
MIT License
315 stars 113 forks source link

403 Forbidden issue on Chrome but working on Firefox #197

Open icycoolnss opened 1 year ago

icycoolnss commented 1 year ago

Task :run SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. HTTP/1.1 403 Forbidden [Content-Type: text/plain; charset=utf-8, X-Content-Type-Options: nosniff, X-Frame-Options: SAMEORIGIN, X-Xss-Protection: 0, Date: Mon, 29 Aug 2022 05:29:47 GMT, Content-Length: 135, Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"] [Content-Length: 135,Chunked: false]

BUILD SUCCESSFUL in 2s 2 actionable tasks: 1 executed, 1 up-to-date

icycoolnss commented 1 year ago

Tried even without payload still no luck :(

jcpearce commented 1 year ago

Same issue. Tried command line and java implementation. Same error. Tested all the same keys with node web-push and it works fine. Any ideas?

jcpearce commented 1 year ago

Figured it out for chrome needed to encode as follows pushService.send(notification, Encoding.AES128GCM);

rpcabrera commented 1 year ago

This happens also for IOs final devices. I tried to change the default encoding as @jcpearce mentioned, but continued receiving the same problem. Now, trying to reproduce the HTTP POST request over the Apple APN itself using the javascript variant result in a success push notification. Considering this, anyone detected a difference between the encryption on Java and Javascript?