Skip to content

Instantly share code, notes, and snippets.

@benhaxe
Created November 20, 2017 13:50
Show Gist options
  • Save benhaxe/d466af4490563158cc9ed10aec178bec to your computer and use it in GitHub Desktop.
Save benhaxe/d466af4490563158cc9ed10aec178bec to your computer and use it in GitHub Desktop.
How to authenticate users using fire base authentication
FirebaseAuth authUser = FirebaseAuth.getInstance();
authUser.signInWithEmailAndPassword(userEmail, userPassword).addOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(Task task) {
if (task.isSuccessful()) {
FirebaseUser user = task.getResult().getUser();
String userEmail = user.getEmail();
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment