firebase-authentication

Firebase passing Authentication between web pages

天涯浪子 提交于 2019-12-11 04:04:47
问题 i don't know how to share the authentication between my web. For example, i want to pass authentication to home page after user logged in in login.html. What is the problem: After user logged in in login.html, the authentication is created. //login.html var user = firebase.auth().currentUser; if (user) { // User is signed in. } However, i need to change location.href to home.html after user logged in. //login.html if (user) { // User is signed in. location.href = "home.html"; } So, what is

I want to open three different activity when I login with their respective roles from firebase database

旧时模样 提交于 2019-12-11 03:27:45
问题 I have three roles in my firebase database teacher Student coordinator. In that, if I log in with teacher then it should check role from the database and open teacher activity. Same for student and coordinator. ** Code:** firebaseAuth.signInWithEmailAndPassword(email, password) .addOnCompleteListener(Login_Form.this, new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (task.isSuccessful()) { Intent intent = new Intent(Login_Form.this,

Refresh Firebase Token

╄→尐↘猪︶ㄣ 提交于 2019-12-11 03:25:46
问题 I'm using web firebase javascript to authenticate by email and password. This process generates a token which I use to verify on my nodejs backend using firebase-admin. Once this token is generated, I store it on the browser local/session storage. The front end is AngularJs which I intercept the http request to inject the token stored within the browser. This is working fine, however after a while this token expire. So what would be the best way to refresh this token before it sends to the

How to create user in Firebase only if database fields are valid?

那年仲夏 提交于 2019-12-11 03:19:52
问题 After reading many articles about additional user data fields (in my case it's just unique username) in Firebase ecosystem, I approached the best (I hope) variant of saving and validating username - use the username as a node key under /users/ . I'm validating username on the client side and inside database rules: ": "$user.matches(/^[0-9A-Z]{3,18}$/i)&& newData.hasChildren(['uid']) && !data.parent().hasChild($user)", I'm facing problems when signing user up. In my SignUp method I save

angularfire: the difference between waitforAuth and requireAuth

泪湿孤枕 提交于 2019-12-11 03:18:41
问题 So I am using requireAuth() from firebase to develop a web app using gulpJs , angularJs and Firebase of cause. I am quite new to the three things. requireAuth() method works great in my app, searching up stuff online, I came across $waitForAuth() and I still can't figure out the difference. From the name, one will wait for authentification but requireAuth() (will obviously also wait right?). When is it ideal to use the $waitForAuth() and when is it ideal to use requireAuth() . myApp.factory(

Firebase authentification works but I get error when using the Google Text to Speech API

夙愿已清 提交于 2019-12-11 03:03:37
问题 I've set up a small android and firebase app... Authentification works like a charm, and in the firebase console, I can see my user, logged in with the Google account. Now I am trying to experiment a little with the Text to Speech api, and in doing so, I followed this tutorial: https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/texttospeech/cloud-client I managed to make the small java app work, by setting the GOOGLE_APPLICATION_CREDENTIALS Environment variable (I followed

How to get the firebase.User in AngularFire2

笑着哭i 提交于 2019-12-11 02:55:31
问题 I am using AngularFire2 (Ionic2) and Firebase Authentication. I am having a problem trying to get the current user. The works for me, but inconsistently. Sometimes it is populated, and sometimes it is null. let user: firebase.User = firebase.auth().currentUser; Is there a way to get the current user more consistently? More Info: I am logging in as follows: import { FirebaseAuth, AuthProviders, AuthMethods } from 'angularfire2'; public auth: FirebaseAuth this.auth.login({ provider:

Android - Firebase Auth Failure

不想你离开。 提交于 2019-12-11 02:50:09
问题 I am developing a simple app. I used Firebase Auth following below document. https://firebase.google.com/docs/auth/android/firebaseui?authuser=0#top_of_page In debug mode, it works fine. In release mode, I create an Apk file, and install it directly, and it works fine too. But when I released it into the PlayStore, and download it then it failed. override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent) { super.onActivityResult(requestCode, resultCode, data) if

Firebase: Observe email verification status in real time

…衆ロ難τιáo~ 提交于 2019-12-11 02:47:13
问题 How would I be able to check in real time if the user verified his email? My flow is like this: User registers Email is sent User sees "Please verify your email" notification Now I would like to: setInterval -> check if email is verified If verified show the "Email verified" notification For this I would need a method that fetches the user data from firebase. Usually you just use the onAuthStateChanged callback to get userdata but I need to explicitly fetch current data. How would I do that?

Is Firebase UID unique across multiple apps?

本秂侑毒 提交于 2019-12-11 02:36:00
问题 I have two different app which connects to same backend server and part of a same applications but different user. Say just like Uber Driver App and Uber User App. Will the UID of a user will be same across different apps or is it limited to a single Firebase Project or single App? I would also like to know, will it cause any harm to use Firebase UID as ObjectId in Mongo? 回答1: As I just responded to your comment here: UIDs are definitely be unique within a single project (so also across all