Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Notification Hub GCM Authentication Error 401

When I am entering the GCM API Key to the Notification Hub, it gives me the error:

{"error":{"message":"SubCode=40000. Failed to validate credentials with GCM.
The remote server returned an error: (401) Unauthorized...TrackingId:4de00134-abe4-41de-9785-009dda22c2bc_M0_M0_G7,
TimeStamp:10/28/2016 8:06:46 AM","code":"BadRequest"}}

Can anyone help me to get out of this?

like image 254
krishan Avatar asked Oct 28 '16 08:10

krishan


2 Answers

For new users of GCM. You should use a Server Key that is auto-generated after creating/importing a project in the Firebase Console:

Starting from Sept. 2016 new server key can only be created in the Firebase Console using the Cloud Messaging tab of the Settings panel. Existing projects that need to create a new server key can be imported in the Firebase console without affecting their existing configuration.

like image 184
AL. Avatar answered Sep 20 '22 13:09

AL.


Yes, you should import the existing project(s) into FireBase and Google automatically generate the Server-Key and use that in Azure Notification Hub.

Server key is now enhanced, but Google recommends to use the latest key.

FireBase URL: https://console.firebase.google.com

Click the "Gear" icon >> Project Settings >> Select "Cloud Messaging"

enter image description here

like image 39
Senthil Kumaran Avatar answered Sep 18 '22 13:09

Senthil Kumaran