Skip to content

Instantly share code, notes, and snippets.

@whytarun
Created October 3, 2023 06:09
Show Gist options
  • Save whytarun/a10b3110114f4726bb1fac29146a8e97 to your computer and use it in GitHub Desktop.
Save whytarun/a10b3110114f4726bb1fac29146a8e97 to your computer and use it in GitHub Desktop.
Implementing Firebase Authentication for user authentication.
FirebaseAuth mAuth = FirebaseAuth.getInstance();
// Sign in with email and password
mAuth.signInWithEmailAndPassword(email, password)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
// User is authenticated
} else {
// Authentication failed
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment