firebase-admin

user access and data control to cloud firestore when calls to firestore are made server side

假如想象 提交于 2021-02-19 08:45:38
问题 I've started a web-based project using nodejs, express, firebase functions, firestore and eventually want to use firebase hosting. So far, I have been able to keep everything server side until I've reached Authorisation and Authentication. I'm using a model view controller structure so calls to firestore are being made server side and therefore the firestore security rules don't work. Firestore security rules only work if you access firestore client side. Can I use google cloud IAM (Identity

ASP.NET FirebaseAdmin fails to initilize - System.MissingFieldException

谁说胖子不能爱 提交于 2021-02-11 13:18:43
问题 I have an ASP.NET ( Web API ) project, I added FirebaseAdmin to the project but it fails to initialize when calling the method FirebaseMessaging m = FirebaseMessaging.GetMessaging(App); Same steps on a new Windows Forms project work just fine, and was able to deliver the message. An exception of type 'System.MissingFieldException' occurred in FirebaseAdmin.dll but was not handled in user code Additional information: Field not found: 'Initializer.DefaultHandleUnsuccessfulResponseFunc'. Used

Firebase on AWS Lambda Import Error

混江龙づ霸主 提交于 2021-02-10 20:14:02
问题 I am trying to connect Firebase with an AWS Lambda. I am using their firebase-admin sdk. I have installed and created the dependancy package as described here. But I am getting this error on Lambda: Unable to import module 'index': Failed to import the Cloud Firestore library for Python. Make sure to install the "google-cloud-firestore" module. I have previously also tried setting up a similar function using node.js but I received an error message because GRPC was not configured. I think that

Firebase onCreate add custom claims to the auth.user

人盡茶涼 提交于 2021-02-10 06:07:01
问题 I am trying to add a custom claims, isRegistered to firebase. My firestore has another user collection to keep register info records. Now I am trying to keep a isRegistered custom claim but I can not seem to get it work. exports.addRegisteredRole = functions.database.ref('/user') .onCreate((snap, context) => { return // **I added this later, but the issue still remains.** admin.auth() .setCustomUserClaims(context.auth.uid, {isRegistered: true}) .then(() => { console.log('done', snap) return {

How to import firebase-functions and firebase-admin in ES6 syntax for transpiling with Babel for Node 10

回眸只為那壹抹淺笑 提交于 2021-02-08 19:02:07
问题 I'm currently writing my cloud functions in ES6 and transpiling with Babel to target the Node v10 environment. And I've noticed something weird. Why is that when I import firebase-functions like this: import functions from 'firebase-functions'; I get this error: ! TypeError: Cannot read property 'https' of undefined at Object.<anonymous> (C:\myProject\functions\index.js:28:55) And to fix it, I need to import it like this: import * as functions from 'firebase-functions'; While the following

What set of APIs count towards Firebase Auth API limits (500requests/second)?

天大地大妈咪最大 提交于 2021-02-08 15:27:18
问题 The firebase auth doc shows that you can only make Firebase Auth API calls up to 500 requests/second per service account & 1000 requests/second per project. e.g. If I use Firebase Auth Admin SDK to invoke getUserByEmail or updateUser , do these operations count toward API limits? How about verifying id tokens using verifyIdToken API? If my project verifies all requests coming in to the server from clients by verifying authIdToken, does that mean that my server's upper scaling threshold will

java: cannot access com.google.auth.Credentials class file for com.google.auth.Credentials not found

半城伤御伤魂 提交于 2021-02-08 15:13:34
问题 I'm using the firebase Admin SDK and im getting this error at runtime: Error:(22, 36) java: cannot access com.google.auth.Credentials class file for com.google.auth.Credentials not found This is the constructor that is throwing the error import com.google.auth.oauth2.GoogleCredentials; import com.google.firebase.FirebaseApp; import com.google.firebase.FirebaseOptions; import com.google.firebase.database.*; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList;

java: cannot access com.google.auth.Credentials class file for com.google.auth.Credentials not found

久未见 提交于 2021-02-08 15:10:55
问题 I'm using the firebase Admin SDK and im getting this error at runtime: Error:(22, 36) java: cannot access com.google.auth.Credentials class file for com.google.auth.Credentials not found This is the constructor that is throwing the error import com.google.auth.oauth2.GoogleCredentials; import com.google.firebase.FirebaseApp; import com.google.firebase.FirebaseOptions; import com.google.firebase.database.*; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList;

Firebase Cloud Messaging function sendToDevice not working

走远了吗. 提交于 2021-02-08 05:24:42
问题 I'm using the following code to send a notification from one device to another using FCM. Everything works fine until before return admin.messaging().sendToDevice(...) . The 'Token ID: ' log displays token ID of the receiver, but when I set the variable token_id to the sendToDevice function, the notification is not called, therefore the notification is not sent. Can someone tell me what's wrong? 'use strict' const functions = require('firebase-functions'); const admin = require('firebase

Cloud Storage for Firebase access error “admin.storage(…).ref is not a function”

試著忘記壹切 提交于 2021-02-07 12:14:26
问题 I am working with Cloud Storage for Firebase and can't figure out how to to access storage files According to https://firebase.google.com/docs/storage/web/start official guide and https://firebase.google.com/docs/storage/web/create-reference this code should be returning root reference let admin = require('firebase-admin') admin.initializeApp({...}) let storageRef = admin.storage().ref() But it throws an error saying TypeError: admin.storage(...).ref is not a function package.json { "name":