firebase-authentication

Securely saving data in Firestore

别说谁变了你拦得住时间么 提交于 2021-01-27 21:45:42
问题 The Firestore documentation shows examples of how to secure data using Firestore security rules based on the request.auth.uid field. These typically look something like this: service cloud.firestore { match /databases/{database}/documents { match /stories/{storyid} { // Only the authenticated user who authored the document can read or write allow read, write: if request.auth.uid == resource.data.author; } } } That makes perfect sense. What I don't understand (and doesn't appear to be shown

How to save new user data to Firebase Realtime Database after Login

丶灬走出姿态 提交于 2021-01-27 21:30:37
问题 I have written a function to write new user data if needed to database like this private void writeNewUserIfNeeded(final String userId, final String username, final String name) { final DatabaseReference usersRef = rootRef.child("users"); usersRef.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { if (!dataSnapshot.hasChild(userId)) usersRef.child(userId).setValue(new User(username, name)); } @Override public void

After login, it display 'Unfortunately, app has stop'

大兔子大兔子 提交于 2021-01-27 20:57:12
问题 I tried to run my login page and suddenly it displays 'Unfortunately app has stop'. Here is my entire logcat stack trace. Any help would be much appreciated. 10-16 11:10:08.946 7285-7285/? I/art: Late-enabling -Xcheck:jni 10-16 11:10:09.022 7285-7285/? W/ResourceType: Found multiple library tables, ignoring... 10-16 11:10:09.028 7285-7285/? W/ResourceType: Found multiple library tables, ignoring... 10-16 11:10:09.036 7285-7285/? W/ResourceType: Found multiple library tables, ignoring... 10-16

Swift - Firebase function signInWithEmail don't execute in the first call

て烟熏妆下的殇ゞ 提交于 2021-01-27 20:36:02
问题 @IBAction func loginEmailButton(sender: AnyObject) { FIRAuth.auth()?.signInWithEmail(email.text!, password: password.text!, completion: { (user, error) in if error != nil { if let errCode = FIRAuthErrorCode(rawValue: error!.code) { switch errCode { case .ErrorCodeInvalidEmail: self.emailLoginStatus = "invalid email" case .ErrorCodeUserDisabled: self.emailLoginStatus = "User account disabled" case .ErrorCodeWrongPassword: self.emailLoginStatus = "Wrong Password" case .ErrorCodeUserNotFound:

Firebase - GetTokenResult, getExpirationTimestamp() not found

梦想与她 提交于 2021-01-27 19:48:12
问题 I am trying below code to obtain token and its expiration time for a Firebase user: fun refreshToken(apiBlock: (() -> Unit)? = null) { val firebaseUser = FirebaseAuth.getInstance().currentUser if (firebaseUser != null) { firebaseUser.getIdToken(false) .addOnCompleteListener { task -> if (task.isSuccessful) { generatedToken = task.result.token val tokenExpirationTime = task.result.expirationTimestamp apiBlock?.invoke() } else { // Handle error -> task.getException(); } } } } However I am

iOS Firebase Auth Domain visible to users

谁说胖子不能爱 提交于 2021-01-27 19:24:36
问题 I have searched for solutions to this issue but everything I've found seems to be applicable to a firebase web app, not to iOS implementations. When verifying a user using firebase phone auth for iOS, I understand the recaptacha is very unlikely to appear. However in the event it does, it creates a webview for the recaptcha like so: Is there any way for me to hide the myProjectId-12345.firebaseapp.com from the user? It's not very clean or secure I'm afraid. I haven't been able to find

Firebase Auth: This app is not authorized to use Firebase

北城以北 提交于 2021-01-27 18:44:36
问题 My app/build.gradle: compile 'com.firebaseui:firebase-ui-auth:2.3.0' compile 'com.google.firebase:firebase-auth:11.0.4' compile "com.android.support:design:26.1.0" compile "com.android.support:customtabs:26.1.0" compile "com.android.support:cardview-v7:26.1.0" And in DEBUG mode I sucess auth. by Firebase Auth. Input phone number Get sms Success confirm by sms OK. It's work fine. But when I want to do this in release mode I get the next error: 回答1: Go to project settings and at the bottom

Trying to set confirm password with firebase auth

本小妞迷上赌 提交于 2021-01-27 18:30:31
问题 I'm trying to program my first app and I'm using firebase auth email-password as my login method. On my sign up activity I want to have email, password and confirm password. I can't make the app check if password >= 6 characters and if password and confirm password are equals before the account is created. The app seems to check if password >= 6 but if thats true it creates the account without checking if password = confirm password. I also would like to display an error message saying that

Why this Angular applications can't handle the user status (logged in\out) changing the displayed content after that the user logged in?

故事扮演 提交于 2021-01-27 16:27:35
问题 I am working on an Angular application using AngularUI (the Angular bundle, this one: https://www.npmjs.com/package/firebaseui-angular) to handle user registration\login on Firebase My application also uses AnularFire 2 and I have the following problem trying to handle the user status (if the user is logged in or logged out). This is my home component TypeScript code: import { Component, NgZone, OnInit } from '@angular/core'; import { AngularFireAuth } from '@angular/fire/auth'; import {

How to handle FirebaseAuth exceptions

为君一笑 提交于 2021-01-27 14:31:35
问题 I'm using the auth service from Firebase it works but I don't know how to handle the error codes of createUserWithEmailAndPassword() like auth/email-already-in-use or auth/invalid-email ,here you can see the error list https://firebase.google.com/docs/reference/js/firebase.auth.Auth#createUserWithEmailAndPassword public void register(View target){ EditText email = (EditText) findViewById(R.id.editTextName); EditText pass = (EditText) findViewById(R.id.editTextPass); Log.d("email",email