-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
messaging/authentication-error #303
Comments
Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information. |
Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight. |
Chances are some of your tokens do not belong to the same Firebase project. The API is working fine as far as I can tell. |
I also has this problem, it seems like the admin.initializeApp can't load the info from credential and go to ask the info from defaultCredientals instead. I also discovered this problem happens since 5.13.0, rolling back to 5.12.1 solves this issue |
@campanagerald Can you check this against the instructions at #302 (comment)? |
hi. thanks a lot guys. ill check it later. |
This hasn't been updated in a while. I'm going to close this. Feel free to reopen/comment if the problem is encountered again. |
I'm having this issue too. It only happens when using @hiranya911 Any help? |
I don't have any additional info than what's shared in my earlier comments. If the problem persists I'd recommend reaching out to Firebase Support along with your project ID and token information. |
I'm seeing this as well, but with the application default credentials. All other functions are fine. |
I am still facing this issue any solution for this? |
Go to GCP Dashboard in your project |
Experiencing this issue as well, even after enabling Firebase Cloud Messaging API. Also only on subscribing/unsubscribing to a topic. Any fix for it? |
I followed the firebase docs on how to create an firebase admin for push notifications. this is how i set it up.
const admin = require('firebase-admin');
const serviceAccount = require('../helpers/privateKey.json');
const { fireBasePushNotification } = require('../config');
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: fireBasePushNotification.database
});
var registrationTokens = [
'imagine this is a token'
];
var topic = 'myTopic'
admin.messaging().subscribeToTopic(registrationTokens, topic)
.then(function(response) {
// See the MessagingTopicManagementResponse reference documentation
// for the contents of response.
console.log('Successfully subscribed to topic:', response);
})
.catch(function(error) {
console.log('Error subscribing to topic:', error);
});
but when i tried to subscribe a topic it respond an error "messaging/authentication-error"
The SDK could not authenticate to the FCM servers. Make sure you authenticate the Admin SDK with a credential which has the proper permissions to send FCM messages. See Add Firebase to your app for documentation on how to authenticate the Admin SDKs.
I generated serviceAccountKey several times it doesnt work.
The text was updated successfully, but these errors were encountered: