firebase-authentication

How to Display The Current Logged In User Firebase

橙三吉。 提交于 2020-03-18 05:31:34
问题 mAuth = FirebaseAuth.getInstance(); mFirebaseDatabase = FirebaseDatabase.getInstance(); myRef = mFirebaseDatabase.getReference().child("Users"); FirebaseUser user = mAuth.getCurrentUser(); userID = user.getUid(); mAuthListener = new FirebaseAuth.AuthStateListener() { @Override public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) { FirebaseUser user = firebaseAuth.getCurrentUser(); if (user != null) { // User is signed in Log.d(TAG, "onAuthStateChanged:signed_in:" + user.getUid()

How do I set the displayName of Firebase user?

无人久伴 提交于 2020-03-17 10:28:11
问题 Bear with me I am new to Google Firebase, sorry for my stupidity According to the JS Auth documentation on the Firebase website, it only shows how to get the displayName and how to update displayName. So I tried to update it. But it is sort of not logical, because how can you update something without creating it. So my question here is, how can I set displayName of user during registeration? function createUser(email, password) { firebase.auth().createUserWithEmailAndPassword(email, password)

Making firebase storage public for reading and writing on android

扶醉桌前 提交于 2020-03-17 10:22:10
问题 I am new to firebase storage. Can anyone tell me how to make the storage files public for reading and writing?. The default code provided by firebase is given below. What changes should I make ? service firebase.storage { match /b/image-view-b1cf5.appspot.com/o { match /{allPaths=**} { allow read, write: if request.auth != null; } } } 回答1: The documentation explains that if no rule expression is provided, the rule evaluates to true: service firebase.storage { match /b/image-view-b1cf5.appspot

Firebase Authentication returning specific user when app is uninstalled and Installed again

半腔热情 提交于 2020-03-15 07:07:26
问题 I have an issue where I am using google sign in for my application + Firebase. Suppose there are 3 users X,Y and Z with whom I am login in my application at one instance of time. My code for checking the user is logged in or not: FirebaseAuth mAuth = FirebaseAuth.getInstance(); FirebaseUser currentUser = mAuth.getCurrentUser(); if(currentUser!=null) { //user logged in and get user detail from currentUser and go to HomePage } else{ //Show sign in button } Scenario : I signed it with multiple

Firebase Authentication returning specific user when app is uninstalled and Installed again

丶灬走出姿态 提交于 2020-03-15 07:06:29
问题 I have an issue where I am using google sign in for my application + Firebase. Suppose there are 3 users X,Y and Z with whom I am login in my application at one instance of time. My code for checking the user is logged in or not: FirebaseAuth mAuth = FirebaseAuth.getInstance(); FirebaseUser currentUser = mAuth.getCurrentUser(); if(currentUser!=null) { //user logged in and get user detail from currentUser and go to HomePage } else{ //Show sign in button } Scenario : I signed it with multiple

Firebase Authentication returning specific user when app is uninstalled and Installed again

别来无恙 提交于 2020-03-15 07:06:23
问题 I have an issue where I am using google sign in for my application + Firebase. Suppose there are 3 users X,Y and Z with whom I am login in my application at one instance of time. My code for checking the user is logged in or not: FirebaseAuth mAuth = FirebaseAuth.getInstance(); FirebaseUser currentUser = mAuth.getCurrentUser(); if(currentUser!=null) { //user logged in and get user detail from currentUser and go to HomePage } else{ //Show sign in button } Scenario : I signed it with multiple

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

Handle Cancel button in FirebaseUI auth page

孤街醉人 提交于 2020-03-05 04:37:52
问题 I use FirebaseUI prebuilt authentication for my swift project. I have two pages/controllers: main and user profile. I have created a navigation controller. When the user profile button is clicked, the login controller will be pushed to the navigation stack. let loginController = SignInController() self.navigationController?.pushViewController(loginController, animated: true) Within the login controller, Firebase UI will be called and popped out from the navigation stack after the login is

Deleting User account with using Passwordless Authentication?

情到浓时终转凉″ 提交于 2020-03-05 03:19:09
问题 I have implemented passwordless SignUp/SignIn from firebase for my react-native app but I can't understand how will the delete account method work if it needs to be reauthenticated with a password or needs a recent SignIn to refresh the token?? In short, how should I use reauthenticateWithCredential() when I'm using Passwordless Authentication?? 回答1: The Firebase documentation on Linking/re-authentication with email link has an example of how to get a credentials object from the email link

Cannot assign value of Type User to type User

寵の児 提交于 2020-03-05 03:13:06
问题 last time my code worked fine as other member suggested. And somehow today, the error appear again. I keep checking but can't figure out how. class AuthFirebase: NSObject { //This is instance of FIRDatabase to read and write data from Firebase database static let dataBase = Database.database().reference() static var currentUserID:String = "" static var currentUser: User? = nil //Create Function to Log In static func LogIn(email:String, password:String, completion: @escaping(_ success: Bool )