Google offers multiple methods of authenticating your app's users in Cloud Platform applications. Each method has different purposes. Maybe this example can help you. In Firebase, when you see an Android example, it refers to a Java one. Also, at the end of the firebase home page you can find this example:
FirebaseAuth auth = FirebaseAuth.getInstance();
auth.signInWithEmailAndPassword(email, password)
.addOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(Task task) {
if (task.isSuccessful()) {
FirebaseUser user = task.getResult().getUser();
String email = user.getEmail();
// ...
}
}
});
You can also look at this document that could be helpful.