firebase-authentication

How to Store Credentials to Local Storage to Allow Firebase Auth to Sign-in

荒凉一梦 提交于 2021-02-05 08:34:47
问题 I'm working in an Angular 10 project, I am also using firebase hosting and cloud firestore (for DB). I am using AngularFire in my project as well. My project is already able to get documents from my firestore collection, and display them (also can edit, delete, and create them). I also set up authentication, where I use AngularFireAuth to sign in and sign out. I also have route guards to only allow users access to info after signing in. I've discovered that Firestore also has rules, and that

Should firebase auth onCreate trigger have more data?

血红的双手。 提交于 2021-02-05 08:19:28
问题 I'm using functions.auth.user().onCreate() as part of a firestore project, and trying to set up some default data when a new user registers. For the front end, I'm using firebase-ui, with Google and Email/Password providers enabled. When I sign in with an email and password, the UI widget prompts to enter a name and set a password. I was expecting to see the name as part of the user parameter in the onCreate() function call, but I'm getting practically nothing: user: { email: 'xxx@yyyy.co.uk'

Is Anonymous Authentication Enough?

北战南征 提交于 2021-02-05 07:56:08
问题 I'm developing an app that doesn't require logging in because there isn't any user-specific data. My original plan was to just make my entire database be read only. However, upon doing some research, I found that those security rules would leave my database very vulnerable. My new plan is to implement anonymous authentication for each new user that opens my app and then delete that user once they exit my app. The security rule would be just to allow reading if the user is authenticated. 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

Undefined is not a function this.setState

蓝咒 提交于 2021-02-05 07:13:25
问题 I created a simple login page, which, once the button is pressed, executes this function : login = (email, password, navigate) => { this.setState({ loginButtonPressed: true }); firebase .auth() .signInWithEmailAndPassword(email, password) .then(function(user) { navigate('Profile'); }) .catch(function(error) { this.setState({ loginButtonPressed: false }); Alert.alert(error.toString()); }); }; Once called, it executes "this.setState({ loginButtonPressed: true })" since the button changes shape

Undefined is not a function this.setState

别等时光非礼了梦想. 提交于 2021-02-05 07:13:05
问题 I created a simple login page, which, once the button is pressed, executes this function : login = (email, password, navigate) => { this.setState({ loginButtonPressed: true }); firebase .auth() .signInWithEmailAndPassword(email, password) .then(function(user) { navigate('Profile'); }) .catch(function(error) { this.setState({ loginButtonPressed: false }); Alert.alert(error.toString()); }); }; Once called, it executes "this.setState({ loginButtonPressed: true })" since the button changes shape

Does firebase auth UID expires or not?

自作多情 提交于 2021-02-05 04:55:52
问题 I'm goning to use auth.UID in my backend web service as api_key for each user I wounder if UID is final key or it expires/changes 回答1: The auth.UID will never expire. One thing to keep in mind is that the auth.UID will always be the same only if the user does not delete his account. If you let the users the posibility to delete their accounts, if they will sing in again into your app, another UID will be generated, which will be different from the first one. Not every time the UID is a good

Firebase Cloud Firestore restrict user access (Banking Application)

狂风中的少年 提交于 2021-02-04 21:51:43
问题 I am working on a banking app using firebase cloud firestore. I have already set the rules like so: // Allow read/write access on all documents to any user signed in to the application service cloud.firestore { match /databases/{database}/documents { match /{document=**} { allow read, write: if request.auth.uid != null; } } } My database is structured like this: /consumers/{consumer_id}/transactions/{transaction_id} the {consumer_id} will contain the account balance for that consumer along

How do I change the number of login attempts in Firebase?

安稳与你 提交于 2021-02-04 21:05:47
问题 I am a mobile developer and I am using firebase for my app which have built with Cordova and Ionic framework. So .. I implemented Firebase Auth functionalities such login/signup, email verification, forgot your password, ... But I found this message today while logging in with app. "We have blocked all requests from this device due to unusual activity. Try again later." How do I change the number of login attempts in Firebase? 回答1: You can't change login attempts. A blocked user can retry

Fireabse UI sign up without requesting user name

流过昼夜 提交于 2021-02-04 08:31:07
问题 Using Firebase UI for sign-in and sign-up, how do I remove the option for a user to sign-up with a first & last name? In other words, only their email and password are required. According to this github issue, the feature to do so has been implemented. Firebase provided Kotlin code for sign-in/sign-up: private fun createSignInIntent() { // Choose authentication providers val providers = arrayListOf( AuthUI.IdpConfig.EmailBuilder().build(), AuthUI.IdpConfig.GoogleBuilder().build()) // Create