firebase-authentication

How to impersonate the database authentication from Firebase Cloud Function with admin privileges?

六月ゝ 毕业季﹏ 提交于 2020-08-08 04:30:06
问题 I have a set of Firebase Functions that works as an API for an application. These Firebase Functions connect to the database with admin privileges as this: const serviceAccount = require(`./config/xxx-firebase-adminsdk.json`); admin.initializeApp({ credential: admin.credential.cert(serviceAccount), databaseURL: DATABASE_URL, }); I was able to create a custom token and I'm receiving/decoding it in the server but I cannot make use of the security rules because the Firebase function is

Dart Error: Unhandled exception: E/flutter ( 5079): Invalid argument: Instance of 'Future<String>'

本小妞迷上赌 提交于 2020-08-07 09:49:07
问题 I am trying to add document to my cloud firestore DB. In this manner. Future<String> currentlyIn()async{ FirebaseAuth auth = FirebaseAuth.instance; String fuser = await auth.currentUser(); }); return fuser.uid; } Map<String, dynamic> votedown() { Map<String, dynamic> comdata = <String, dynamic>{ 'user_Id':currentlyIn(), 'actual_vote':0, 'voteUp': false, }; return comdata; } DocumentReference storeReference =Firestore.instance.collection('htOne').document('docq'); await storeReference.setData

When to set Firebase auth state persistence

社会主义新天地 提交于 2020-08-07 08:19:44
问题 according to the guide, the firebase auth state persistance is set before the actual login method is called: firebase.auth().setPersistence(firebase.auth.Auth.Persistence.SESSION) .then(function() { // Existing and future Auth states are now persisted in the current // session only. Closing the window would clear any existing state even // if a user forgets to sign out. // ... // New sign-in will be persisted with session persistence. return firebase.auth().signInWithEmailAndPassword(email,

How can I check if user exists in Firebase?

依然范特西╮ 提交于 2020-08-06 12:53:30
问题 I finally got my authentication to work in terms of creating users and logging in and out. But now, I want to implement something that checks if the user already exists in Firebase. I've looked it up but can't seem to find a concrete answer. For example, if my email address is: abc12@gmail.com and someone else tries to signup with the same email address, how do I tell them it's already taken? login(e) { e.preventDefault(); fire.auth().signInWithEmailAndPassword(this.state.email, this.state

How can I check if user exists in Firebase?

折月煮酒 提交于 2020-08-06 12:52:11
问题 I finally got my authentication to work in terms of creating users and logging in and out. But now, I want to implement something that checks if the user already exists in Firebase. I've looked it up but can't seem to find a concrete answer. For example, if my email address is: abc12@gmail.com and someone else tries to signup with the same email address, how do I tell them it's already taken? login(e) { e.preventDefault(); fire.auth().signInWithEmailAndPassword(this.state.email, this.state

How to use the sendPasswordResetEmail() function on the server using the firebase-admin SDK?

你说的曾经没有我的故事 提交于 2020-08-05 19:26:31
问题 In the past, I have used firebase.auth in the web client and once a user creates another user, I link certain security logic: Once the user has been created I send an email to verify your email with the function user.sendEmailVerification (). As the user was created by another user, I assign a default password and use the sendPasswordResetEmail () function so that the user registers his new password. That has worked well for me so far, but now for many reasons I need to move that logic to my

How to use the sendPasswordResetEmail() function on the server using the firebase-admin SDK?

青春壹個敷衍的年華 提交于 2020-08-05 19:26:08
问题 In the past, I have used firebase.auth in the web client and once a user creates another user, I link certain security logic: Once the user has been created I send an email to verify your email with the function user.sendEmailVerification (). As the user was created by another user, I assign a default password and use the sendPasswordResetEmail () function so that the user registers his new password. That has worked well for me so far, but now for many reasons I need to move that logic to my

Using Firebase in a multi-module project

给你一囗甜甜゛ 提交于 2020-08-04 11:54:49
问题 I have a multi-module multi-flavor android project, the modules are as follows: core module, which is an android library that holds common stuff, including library dependencies. authentication module, which is as the name suggests, a module that contains a bunch of UI activities and is responsible for authenticating users. It's also the module that has the launcher activity. user module, which is another android library module. It is responsible for handling user profile UI, user data, along

Using Firebase in a multi-module project

拜拜、爱过 提交于 2020-08-04 11:54:02
问题 I have a multi-module multi-flavor android project, the modules are as follows: core module, which is an android library that holds common stuff, including library dependencies. authentication module, which is as the name suggests, a module that contains a bunch of UI activities and is responsible for authenticating users. It's also the module that has the launcher activity. user module, which is another android library module. It is responsible for handling user profile UI, user data, along

Firebase Auth Login must allow single device login

时光总嘲笑我的痴心妄想 提交于 2020-08-03 10:35:31
问题 I am developing app with the help of Firebase backend and I am using Firebase Auth for login into my application. I have done all integration and every thing and my app is working fine. But I want only single session with single user as right now with single userId I am able to login through multiple devices. So I want to restrict user that at a time user can login in in single device. I am using Custom auth with username password login : Auth.auth().signIn(withCustomToken: customToken ?? "")