Groups
Groups
Sign in
Groups
Groups
Firebase Google Group
Conversations
About
Send feedback
Help
import VAPID registrations into firebase asks for OAuth2
150 views
Skip to first unread message
Nikola Barac
unread,
Jun 27, 2018, 10:07:52 AM
6/27/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Firebase Google Group
I'm following the steps described in google doc:
https://developers.google.com/instance-id/reference/server#import_push_subscriptions
and I'm getting the 401 error message when trying to import one VAPID registration via curl:
"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See
https://developers.google.com/identity/sign-in/web/devconsole-project
."
My request looks like this:
curl -X POST -H "Authorization:key=hidden-authorization-key"
-H "Content-Type:application/json"
-d @data.json
https://iid.googleapis.com/v1/web/iid
And here is the data.json content
{"endpoint": "
https://fcm.googleapis.com/fcm/send/hidden-endpoint-hash
",
"keys": {
"auth": "hidden-auth",
"p256dh": "hidden-p256dh"}
}
Note: we used the same hidden-authorization-key when we were importing ios tokens via the batchImport endpoint described here:
https://developers.google.com/instance-id/reference/server#create_registration_tokens_for_apns_tokens
which worked as expected but the webpush import asks for OAuth2 which is strange since we are sending the Authorization:key.
Frank van Puffelen
unread,
Jun 27, 2018, 10:10:09 AM
6/27/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Firebase Google Group
Also posted on:
https://stackoverflow.com/questions/51059130/import-vapid-registrations-into-firebase-asks-for-oauth2
Reply all
Reply to author
Forward
0 new messages