firebase-authentication

Persist Firebase user for Node.js client application

社会主义新天地 提交于 2019-12-24 12:49:41
问题 I'm building a Node.js command-line interface (CLI) using Firebase for authentication with the back end. I want to avoid making the user type their password every time they run a command. Instead, I want to implement a "login" flow that persists a credential to the filesystem that can be used for subsequent password-less authentication until the user "logs out". Basically what I'm looking for is the firebase JavaScript SDK's "auth state persistence" feature. Unfortunately that feature is not

Is it possible to enable Firebase email authentication but disable sign in?

好久不见. 提交于 2019-12-24 11:35:53
问题 In my app, I'm already using the Firebase authentication with Google accounts, but I'd also like to authorize some users who have no Google account. So I'd like to manually add them to the authorized server from the firebase console and to enable the email authentication. What I don't want is random users to be able to create an account on my app with their email. Is it possible ? I didn't find a parameter to disable sign in... 回答1: I don't think this is possible who can sign in on an

How to properly continue tasks when a given parameter is different

烂漫一生 提交于 2019-12-24 10:50:02
问题 I'm facing tasks right now and I have doubts. After an email/pass registration, I had to update the user's profile. So I first tried this: FirebaseAuth.getInstance().createUserWithEmailAndPassword(email, password); .continueWithTask(new Continuation<AuthResult, Task<Void>>() { @Override public Task<Void> then(@NonNull Task<AuthResult> t) throws Exception { UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder() .setDisplayName(fullname) .build(); return t.getResult()

How can I register a username in Firebase?

时间秒杀一切 提交于 2019-12-24 09:34:11
问题 I am trying to implement the registration of a username in Firebase since it only gives me methods that are like the createUserWithEmailAndPassword() , but you can not create a username and I do not know how to do it... Below is my register code,but I also want to enter a user name that can use it, when the user publishes something etc, such as the getEmail() method, also being able to have a getUsername() . auth.createUserWithEmailAndPassword(email, password).addOnCompleteListener

firebase connection check online offline status in android

随声附和 提交于 2019-12-24 08:35:26
问题 If user turn off both wi-fi, 3g, 4g, and so on and reverse (no internet connection). Firebase database name child connections:(true/false) So, when internet connections, wi-fi, 3g, 4g, and so on are off or missing, the user is offline so he can't be found. Remember the two scenarios: Before and After. If user is offline before an other user search him, then he will not displayed in the list result, if user is off-line after an other user search him, then it will display NO MORE AVAILABLE icon

Firebase creating extra user data upon account creation

北战南征 提交于 2019-12-24 08:34:23
问题 I am using Firebase with Angular 2 to create new users. I would like to extend this by adding additional data for each newly created user. In this example, I would like to have every newly created user start with an assigned property of net worth = 5000 . So my schema would look something like: email | '' password | '' net worth | '5000' Having gone through the Firebase docs, I have found the save data feature. However, I am unsure how to merge the set feature with my username and password

Firebase auth linking error - User can only be linked to one identity for the given provider

家住魔仙堡 提交于 2019-12-24 08:30:00
问题 When users first run my app it creates an anonymous account for them, which if they decide to use higher level features, will be converted to an email authenticated account Code for anon sign in is straightforward (taken directly from the docs) // No user is signed in. Auth.auth().signInAnonymously() { (usr, err) in if (err == nil) { print("Anon User ID \(usr!.uid)") } else { print("Anon auth error \(String(describing: err!.localizedDescription))") } } When registering, I create a new account

Handling one hour token expiration in Firebase generated from iOS used for node auth

大城市里の小女人 提交于 2019-12-24 08:29:20
问题 The flow for my application: Login into Firebase through iOS. Retrieve the firebase token and store in the keychain - FIRAuth.auth()?.currentUser?.getTokenWithCompletion({ (token, err) in //store token in keychain }) This token is sent in the header to my node server to authenticate requests - firebase.auth().verifyIdToken(firebaseAccessToken).then(function(decodedToken) { //allow access to api } The token then expires after an hour. My question is how should I handle this? Store the time the

Catching 401 and refreshing Firebase Id Token

爱⌒轻易说出口 提交于 2019-12-24 08:06:11
问题 My app uses Firebase to authenticate users by phone number, a migration from Digits. I add the idToken from Firebase to my calls. I listen with an interceptor on my httpclient if a 401 was trown, if so, I logged out. I noticed after one hour the 401 came in, so I added an addIdTokenListener in my App class. When it changes I update my token to sign my calls. It worked, but not flawless, sometimes a 401 was thrown and I still logged the user out... I am writing something in my interceptor to

Firebase - Prevent user authentication

主宰稳场 提交于 2019-12-24 07:58:41
问题 I need to prevent user authentication if their email isn't found in allowedUsers . It doesn't really affect the app, since all the actions will be performed on the users list, but it will be nice if the authentication doesn't happen. loginWithGoogle() { const userDetails = this.afAuth.auth.signInWithPopup(new firebase.auth.GoogleAuthProvider()) .then(user => { console.log(user.user.uid); const queryObservable = this.db.list('/allowedUsers', { query: { orderByChild: 'email', equalTo: user.user