New issue
Advanced search Search tips

Issue 712776 link

Starred by 3 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Web Push with VAPID returns 400 'UnauthorizedRegistration'

Reported by msele...@usekahuna.com, Apr 18 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36

Steps to reproduce the problem:
1. generate VAPID private/public key with openssl
2. subscribe user to receive push notification
3. try sending that user a push on chrome, receive 400 error
4. tried the same steps on firefox and it works perfectly

What is the expected behavior?
receive a 201 from FCM indicating that the message has been accepted

What went wrong?
received 400, UnauthorizedRegistration, from FCM

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 57.0.2987.133  Channel: stable
OS Version: OS X 10.12.4
Flash Version:
 
Labels: TE-NeedsTriageHelp

Comment 3 by bhhro...@justin.tv, Jun 12 2017

Is there any movement on this?

I am facing a (presumably) the same issue. I am using the Vapid02 specification, and have ruled out the possibility that is a bad TTL/exp due to system clock jitter(did this by ensuring TTL/exp is an hour and not the max). It works as expected in Firefox, but is failing in Chrome 59.

Comment 4 by peter@chromium.org, Jun 20 2017

#0 - Did you subscribe with the public key as the `applicationServerKey`?

#3 - It's certainly possible that there's an issue with our vapid2 implementation. I'll run some tests to see whether I can find anything obvious.

Comment 5 by peter@chromium.org, Jun 20 2017

Owner: peter@chromium.org
Status: Started (was: Unconfirmed)
Yeah, it looks like we're not supporting VAPID 2 correctly. Will follow up.

https://tests.peter.sh/push-generator/#authentication=1;;padding=0

Comment 6 by peter@chromium.org, Jun 20 2017

... or at all in our existing infrastructure. We're working on a new backend that does support it, but it's not quite ready to launch just yet. I'll keep you updated.
Was this ever fixed ? I am facing the same issue (works on firefox but not on chrome).
I did find a solution but it was weird and i dont remember EXACTLY the issue, but, i either had an '/' at the end of the subscription URL endpoint or there was no '/' at the end and there should have been... seriously that ended up being the fix
Well, since I didn't have '/' at the end, I added and I am seeing a different error message now (still 400 but invalidtokenformat now).
Not sure what to make of it though.

Thanks for replying 
As an update for other wandering souls, I was able to fix it finally.

1. The slash '/' was NOT supposed to be there in endpoint. Removed.

2. JWT header was missing "typ":"JWT" in the header. Added that.

3. JWT payload expiration time was incorrectly a string instead of int. Converted that to int.

Fixed these and it worked.

Sign in to add a comment