firebase-authentication

Firebase Auth: Android: Unable to display user email and photo

亡梦爱人 提交于 2019-12-06 09:11:48
I have added Firebase Auth in my android app and I am using Facebook and Google sign in. Signing in is working fine. Now I want to retrieve user profile info from user's either Facebook account or Google account (whichever, user chooses to sign in) and display the info in user profile activity. I am able to retrieve and display user name and user UID, however, user email and user photo are not displaying, though retrieved. Here is how I am retrieving user info (LoginActivity.java): authStateListener = new FirebaseAuth.AuthStateListener() { @Override public void onAuthStateChanged(@NonNull

ReactJS app authentication: Firebase+FirebaseUI Uncaught Error: Firebase App named '[DEFAULT]-firebaseui-temp' already exists

六眼飞鱼酱① 提交于 2019-12-06 08:52:18
I'm having trouble with my code. I'm building a one page web app in ReactJS with 3 tabs. When the user goes to one tab, the authentication form from FirebaseUI should show up. The thing is that it's working only the first time and the second time, if I change to another tab and come back, it crashes, React re-renders the component that renders the div with the authentication form and throws the error: "firebase.js:26 Uncaught Error: Firebase App named '[DEFAULT]-firebaseui-temp' already exists." My index.html is : <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name=

How can I verify a method is run in a mocked class's callback?

廉价感情. 提交于 2019-12-06 08:22:31
I have a utility class in my Android code that handles the authentication of users. I'm writing unit tests for this class with Mokcito to verify that a listener is being notified if the creation of a new user had succeeded or failed. Here is one of this utility class's methods: public void createNewUser(String email, String password) { firebaseAuth.createUserWithEmailAndPassword(email, password) .addOnSuccessListener(authResult -> { authListener.newUserCreated(); }) .addOnFailureListener(e -> { authListener.failedCreatingNewUser(); }); } I am mocking FirebaseAuth and I want to verify that

Flutter Stream Builder Triggered when Navigator Pop or Push is Called

房东的猫 提交于 2019-12-06 07:53:30
问题 I have a stream builder in the app's home/root page. This stream builder gets triggered whenever I do a page-navigation elsewhere, which has nothing to do with the stream itself. My understanding, according to here and here, is when a page is popped/pushed in the navigator, it triggers a rebuild on the app, so the stream builder gets re-attached and so it fires. However this seems inefficient, so is there a way to prevent the stream builder from firing when a page is popped/pushed?

location.protocol\" must be http or https

人走茶凉 提交于 2019-12-06 07:50:02
I developing a hybrid mobile application using Cordova + Angular 2 + Ionic 2. When using firebase Auth, when calling signInWithPopup() or signInWithRedirect() for social logins, firebase returns error "This operation is not supported in the environment this application is running on. "location.protocol" must be http or https." There's also a number of comments on this article, about same thing: https://firebase.googleblog.com/2016/01/social-login-with-ionic_77.html This is because the location.protocol is file:// and NOT http/s. All hybrid apps will have this issue. Help. 来源: https:/

OAuth SignIn Cordova Firebase

五迷三道 提交于 2019-12-06 07:41:32
I tried to use OAuth SignIn Cordova Firebase in a hybrid cordova app following the steps from this firebase tutorial: Authenticate Using OAuth Providers with Cordova But I did not succeed and get the error message below: Error: {"code":"auth/operation-not-supported-in-this-environment","message":"This operation is not supported in the environment this application is running on. \"location.protocol\" must be http, https or chrome-extension and web storage must be enabled."} I found the solution, the issue was corrected in the latest Firebase JavaScript SDK release (4.1.3) Firebase JavaScript

How to use Facebook token obtained through Firebase authentication appropriately?

做~自己de王妃 提交于 2019-12-06 07:40:42
I am trying to get a person's first name and last name when the person would like to sign up through Facebook, but wondering if there can be some security issue. Based on the document from Firebase , the answer from Stack Overflow , and the explanation about parameters from Facebook website , I wrote the following codes: firebase.auth().getRedirectResult().then(function(result) { var token = result.credential.accessToken; FB.api('/me', {fields: 'last_name', access_token: token}, function(response) { console.log(response); }) }) My main concern is that according to Facebook, it says: One

How to work with FirebaseAuth inside Android Module

╄→尐↘猪︶ㄣ 提交于 2019-12-06 07:16:48
问题 I am developing a Chat library in which I want to show the conversations of the logged in user. The reason to make the library is that I want to integrate it in multiple projects. The problem I am facing right now is that FirebaseAuth is indicating that the user is not logged-in ( FirebaseAuth.getInstance(mFirebaseApp).getCurrentUser() always returning null ) even if the user is authenticated inside the app. How the Module/Library can know that the user is authenticated? I am trying the

android firebase 12.0.0 - mAuth.getCurrentUser().getProvider() method is removed, how to get provider names?

三世轮回 提交于 2019-12-06 06:39:27
问题 in firebase_version = '11.8.0' there was a method called mAuth.getCurrentUser().getProviders() i could call to get the list of provider names. so for email provider it was "password" and for facebook is was "facebook.com", etc the method call was like this: final FirebaseUser currentUser = mAuth.getCurrentUser() for (String provider : this.currentUser.getProviders()) { //i was looping over all the providers this way, and then storing the provider string in my db } but now in the latest

Firebase authentication tokens expiration duration

醉酒当歌 提交于 2019-12-06 06:27:19
问题 I just upgraded to the new version of Firebase and I can't find where I can set the expiration duration of my Firebase authentication tokens. It used to be under the authentication section in Firebase's old layout (I had it set for 1 year). Does Firebase still have this? 回答1: If you keep using the Firebase 2.x SDK, your expiration period will be the same as before. You cannot change the value anymore though. If you upgrade your code to use the 3.x SDK, it'll switch to user a never-expiring ID