firebase-authentication

How to check for a phone auth user in Android?

瘦欲@ 提交于 2021-02-01 05:10:43
问题 How to modify this onStart() method to get my separate Phone auth user database? @Override protected void onStart() { super.onStart(); FirebaseAuth firebaseAuth = FirebaseAuth.getInstance(); if (firebaseAuth.getCurrentUser() != null) { if(what condition required to check for phone auth){ startActivity(new Intent(EnterAs.this, UI_Main_User.class)); finish(); } else { for email auth users } } 回答1: You can do that by calling UserInfo's getProviderData() method on the FirebaseUser object, to get

How to check for a phone auth user in Android?

让人想犯罪 __ 提交于 2021-02-01 05:10:10
问题 How to modify this onStart() method to get my separate Phone auth user database? @Override protected void onStart() { super.onStart(); FirebaseAuth firebaseAuth = FirebaseAuth.getInstance(); if (firebaseAuth.getCurrentUser() != null) { if(what condition required to check for phone auth){ startActivity(new Intent(EnterAs.this, UI_Main_User.class)); finish(); } else { for email auth users } } 回答1: You can do that by calling UserInfo's getProviderData() method on the FirebaseUser object, to get

How to check for a phone auth user in Android?

穿精又带淫゛_ 提交于 2021-02-01 05:10:06
问题 How to modify this onStart() method to get my separate Phone auth user database? @Override protected void onStart() { super.onStart(); FirebaseAuth firebaseAuth = FirebaseAuth.getInstance(); if (firebaseAuth.getCurrentUser() != null) { if(what condition required to check for phone auth){ startActivity(new Intent(EnterAs.this, UI_Main_User.class)); finish(); } else { for email auth users } } 回答1: You can do that by calling UserInfo's getProviderData() method on the FirebaseUser object, to get

How can any user write to my database securely in Firebase without Auth?

▼魔方 西西 提交于 2021-01-29 21:38:06
问题 So if I have an E-commerce App that doesn't require Login/Auth, and my users buy in the store, then after verifying the transaction the backend writes the order in the database. The thing is that my Realtime Database just relies on Stripe transaction key (i.e, someone has paid for an item) to be able to write on the DB, because my rules are set so anyone can write, otherwise I would need every user to log in, but that's not what I want. Firebase recently notified me that my rules are weak.

What will happen if I sign in user using phone number without user creation in firebase?

时光毁灭记忆、已成空白 提交于 2021-01-29 21:21:07
问题 So, I am trying to create a sign-in and sign-up flow using firebase with primary requirement using phone number. But I found that I am only able to sing up the user using createUserWithEmailAndPassword only. Now the issue is how do I sign up the user using phone number. If not then how does firebase sign in user using phone number? 回答1: A Firebase Authentication user account is created when signing up/in with phone number when you call the signInWithCredential method. At that point you can

How do I switch to a different view controller from the App Delegate?

末鹿安然 提交于 2021-01-29 20:22:16
问题 Once the user signs in with Google, I want to take them to the home screen; however, the code does not fully execute this. This is the code: func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) { if let error = error { if (error as NSError).code == GIDSignInErrorCode.hasNoAuthInKeychain.rawValue { print("The user has not signed in before or they have since signed out.") } else { print("\(error.localizedDescription)") } return } let firstName = user

How to integrate security rules into Firestore client from Python's server client library?

孤者浪人 提交于 2021-01-29 15:30:44
问题 I am trying to test my security rules using the Firestore emulator. I made a firestore.rules security rule that disallows all reads and writes: service cloud.firestore { match /databases/{database}/documents { allow read, write: if false; } } I started the Firestore emulator from the terminal: firebase emulators:start --only firestore I then initialized my Firestore client: import firebase_admin from firebase_admin import firestore firebase_app = firebase_admin.initialize_app() self.client =

Right way to implement Firebase Auth with State listener Swift 5

戏子无情 提交于 2021-01-29 14:54:37
问题 very new to ios development and Firebase. I have implemented a standard run-of-the-mill ui flow where the app opens to a splash-screen, where it's checked whether user is signed in or not and depending on the state the user is redirected to the login screen or home screen. I'm trying to get a user id from auth listener, and some of my getUserId calls from the userManager are happening before the firebase auth gives a non-nil user id, and the user always ends up going to the registration

Firebase onAuthStateChanged error with React

北慕城南 提交于 2021-01-29 14:24:41
问题 I'm trying to check if a user is logged in or not on my React webpage using Firebase, however I keep getting an error TypeError: Cannot read property 'onAuthStateChanged' of undefined , the line of code it links to is as followed: Login.js: authListener() { Fire.auth.onAuthStateChanged((user) => { if (user) { this.setState({ user }) } else { this.setState({ user: null }) } })} Fire.js: import firebase from 'firebase' const config = { apiKey: "xxx", authDomain: "xxx", databaseURL: "xxx",

Firebase Email Link only for existing users (forbid new users)

白昼怎懂夜的黑 提交于 2021-01-29 14:14:03
问题 How one can forbid new users to sign in using Firebase Email Link? So only exiting customers can sign in. I want to register only users that will subscribe via Stripe and create new account server-side. Also, if I may do it in the same thread: how can I edit email template that is sent to the new user? In console this one is not available. 来源: https://stackoverflow.com/questions/61779992/firebase-email-link-only-for-existing-users-forbid-new-users