firebase-admin

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

与世无争的帅哥 提交于 2021-02-07 12:14:16
问题 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":

Verifying ID tokens with Firebase Authentication

你说的曾经没有我的故事 提交于 2021-02-06 09:18:27
问题 We are starting the development of a web app and were thinking of using Firebase Authentication to handle our sign up flow. However, we are unsure about how the ID token verification works. It seems possible to verify a user with its token outside the Firebase realm. We are thinking of having a Node.js app on Google Kubernetes Engine – as far as I know, it does not integrate with Firebase Authentication. Firebase provides this example on how to verify ID tokens using the Firebase Admin SDK: /

Calling a firebase cloud function from nodejs

余生长醉 提交于 2021-02-05 11:44:26
问题 I want to call a cloud function from firebase from another nodejs server or just a nodejs script. My firebase function is an onCall function. I am using https://www.npmjs.com/package/firebase-admin for interacting with firebase but it doesn't seem to have a way of calling cloud functions... Can I do it any other way? Like a http request? 回答1: In short: You have to trigger http event. Currently, firebase does support two invoke options. If you read through documentation here and here, there is

Firebase admin on backend for verifyIdToken and use Firestore

∥☆過路亽.° 提交于 2021-02-05 07:24:25
问题 I'm trying to use Firebase Admin on my backend for "faking" client authentication by verifying Id Token in order to use firestore from the backend. The idea is to use my server as a middleware between my client and firestore. I can initialize FirebaseAdmin on the backend and verifyIdToken() from client properly, but I don't have an idea for using firestore after that. Can you guys show me a way for doing it? import * as firebaseAdmin from 'firebase-admin'; import firebaseServiceAccountKey

Firebase Storage image uploads from Java don't show thumbnail preview in the Firebase console

て烟熏妆下的殇ゞ 提交于 2021-02-02 09:55:49
问题 i am trying to upload an image to firebase storage using java. The image is successfully uploaded but when you see it in the firebase it doesn't load ... here is the code, is it correct? FirebaseOptions options = FirebaseOptions.builder().setCredentials( GoogleCredentials.fromStream(getClass().getResourceAsStream("/credentials.json"))).setDatabaseUrl("https://myexample.firebaseio.com") .setStorageBucket("myexample-123456.appspot.com").build(); FirebaseApp fireApp = FirebaseApp.initializeApp

Firebase Storage image uploads from Java don't show thumbnail preview in the Firebase console

北城余情 提交于 2021-02-02 09:54:27
问题 i am trying to upload an image to firebase storage using java. The image is successfully uploaded but when you see it in the firebase it doesn't load ... here is the code, is it correct? FirebaseOptions options = FirebaseOptions.builder().setCredentials( GoogleCredentials.fromStream(getClass().getResourceAsStream("/credentials.json"))).setDatabaseUrl("https://myexample.firebaseio.com") .setStorageBucket("myexample-123456.appspot.com").build(); FirebaseApp fireApp = FirebaseApp.initializeApp

How to get access to the firebase Authentication part

让人想犯罪 __ 提交于 2021-02-02 08:18:17
问题 In my app I've 2 login methods(google&facebook) and all the users appear in the Authentication part inside my firebase project, and I haven't list/collection of my users in my database. I want to display in my app list of users with some personal data. My question is how do i get access to the users from the Authentication part(to get all the users for example)? Is it good approach that the users appear only in the Authentication and not inside my database? 回答1: You can't list user accounts

How to get access to the firebase Authentication part

耗尽温柔 提交于 2021-02-02 08:13:24
问题 In my app I've 2 login methods(google&facebook) and all the users appear in the Authentication part inside my firebase project, and I haven't list/collection of my users in my database. I want to display in my app list of users with some personal data. My question is how do i get access to the users from the Authentication part(to get all the users for example)? Is it good approach that the users appear only in the Authentication and not inside my database? 回答1: You can't list user accounts

firebase-admin (nodejs) cannot verify auth token (JWT)

萝らか妹 提交于 2021-01-29 21:02:02
问题 I am using firebase-admin (node-js) to verify Auth token. I am using the sample provided by firebase docs I have tried to decode the token I am using, and it works { "iss": "https://securetoken.google.com/xxxxxx", "aud": "xxxxxxx", "auth_time": 1557423742, "user_id": "xxxxxxxxxxxxx", "sub": "xxxxxxxxx", "iat": 1557427419, "exp": 1557431019, "email": "xxxxx@gmail.com", "email_verified": false, "firebase": { "identities": { "email": [ "xxxxx@gmail.com" ] }, "sign_in_provider": "password" } } I

firebase-admin (nodejs) cannot verify auth token (JWT)

最后都变了- 提交于 2021-01-29 18:29:09
问题 I am using firebase-admin (node-js) to verify Auth token. I am using the sample provided by firebase docs I have tried to decode the token I am using, and it works { "iss": "https://securetoken.google.com/xxxxxx", "aud": "xxxxxxx", "auth_time": 1557423742, "user_id": "xxxxxxxxxxxxx", "sub": "xxxxxxxxx", "iat": 1557427419, "exp": 1557431019, "email": "xxxxx@gmail.com", "email_verified": false, "firebase": { "identities": { "email": [ "xxxxx@gmail.com" ] }, "sign_in_provider": "password" } } I