firebase-admin

How can I list all users using firebase admin sdk

偶尔善良 提交于 2020-03-21 07:23:10
问题 Is there a way to list all the users using the firebase admin sdk? Documentation only shows getting one user either by uid or email. 回答1: Update As @Webp says in their answer, there is now an API to list all users in the Admin SDK. Original answer: There is no public API to retrieve a list of users from the Firebase Admin SDK. The typical way to deal with this scenario is to keep a list of the pertinent user information in the Firebase Database. See this original question for more: How do I

How Can I Obtain GCP service account credentials on Google Cloud Run?

ⅰ亾dé卋堺 提交于 2020-03-05 06:07:51
问题 This page explains both: Obtaining and providing service account credentials manually for developing local, deploying on-premises, or deploying to another public cloud. Obtaining credentials on Compute Engine, Kubernetes Engine, App Engine flexible environment, and Cloud Functions But there is no mention of obtaining credentials on Cloud Run. I'd appreciate it if you give instructions for obtaining credentials and setting firebase-admin initializeApp and firebase initializeApp for

How Can I Obtain GCP service account credentials on Google Cloud Run?

柔情痞子 提交于 2020-03-05 06:06:28
问题 This page explains both: Obtaining and providing service account credentials manually for developing local, deploying on-premises, or deploying to another public cloud. Obtaining credentials on Compute Engine, Kubernetes Engine, App Engine flexible environment, and Cloud Functions But there is no mention of obtaining credentials on Cloud Run. I'd appreciate it if you give instructions for obtaining credentials and setting firebase-admin initializeApp and firebase initializeApp for

How to sign in with email and password using firebase admin sdk in Android

跟風遠走 提交于 2020-03-05 05:54:34
问题 I'd like to create an Android application based on firebase. I'd like my application to autheticate users and check what their role is; so I used the method signInWithEmailAndPassword coming from the object FirebaseAuth.getInstance() to log. Then I thought to save for each user a claim so I could keep track of their roles and to do this I use the Firebase admin SDK; problem is I no longer have the method signInWithEmailAndPassword on the class FirebaseAuth so I can't log my users. What can I

In firebase authentication, is there a way to remove a custom claim?

混江龙づ霸主 提交于 2020-02-28 05:57:05
问题 In order to set a custom claim, one uses: admin.auth().setCustomUserClaims(uid,{claim:value}); There does exist admin.auth().updateUser(uid,{claim:value}); ...but I'm not exactly clear on how the two are different, and neither one seems to get at actually removing a previously applied custom claim. 回答1: From the documentation: You can delete a user's custom claims by passing null for customClaims . So this should delete the claim: admin.auth().updateUser(uid, {claim: null}); 回答2: I don't

Firebase messaging/mismatched-credential

空扰寡人 提交于 2020-02-20 07:26:36
问题 I'm trying to send notifications to a specific device with Firebase but am getting the following error: {"r": {"results":[{"error":{"code":"messaging/mismatched-credential","message":"The credential used to authenticate this SDK does not have permission to send messages to the device corresponding to the provided registration token. Make sure the credential and registration token both belong to the same Firebase project."}}],"canonicalRegistrationTokenCount":0,"failureCount":1,"successCount"

Mock a token for flask unit tests - firebase-admin-python SDK

蓝咒 提交于 2020-02-04 03:12:28
问题 I am using the firebase-admin-python SDK to handle authentication between an iOS app and a flask backend (python). This is my backend authentication endpoint, following the firebase guide: from flask import request from firebase_admin import auth def get(): """accessed via '/api/authtoken' """ try: fir_token = request.headers["Authorization"] decoded_token = auth.verify_id_token(fir_token) fir_auth_id = decoded_token["uid"] except: ... How do I mock the fir_token for a unit test? How do I

Mock a token for flask unit tests - firebase-admin-python SDK

狂风中的少年 提交于 2020-02-04 03:11:52
问题 I am using the firebase-admin-python SDK to handle authentication between an iOS app and a flask backend (python). This is my backend authentication endpoint, following the firebase guide: from flask import request from firebase_admin import auth def get(): """accessed via '/api/authtoken' """ try: fir_token = request.headers["Authorization"] decoded_token = auth.verify_id_token(fir_token) fir_auth_id = decoded_token["uid"] except: ... How do I mock the fir_token for a unit test? How do I

How to authenticate a firebase user from server without client side auth?

杀马特。学长 韩版系。学妹 提交于 2020-01-31 05:41:45
问题 I have an API which uses the node admin sdk to connect and call to firebase. My clients hit my api for all the things they need. I do not want them to have to call out to firebase to authenticate directly because I want the client code decoupled from the api and backend. How can the server authenticate them? Based on current docs even at minimum clients must provide their uid to the api (which assumes they authenticated on their own, right?). Ideally, the clients would provide username and

Firebase Admin SDK Java Backoff/retry

烈酒焚心 提交于 2020-01-24 21:50:07
问题 In implementing a Firebase Server Environment I ran across some requirements in the documentation: https://firebase.google.com/docs/cloud-messaging/server#role Namely, the requirement that the server provide facilities for backoff/retry. Is there some direction as to how the Firebase Admin SDK usage should be wrapped in such logic or is the logic contained within the SDK itself? I did see this in the Firebase Admin SDK release notes that does mention handling of retry for 500 response codes: