2

I'm getting a error like:

Projects created at console.firebase.google.com must use the new Firebase Authentication SDKs available from firebase.google.com/docs/auth/

when I'm calling:

Firebase authenticateUser = new Firebase(ReferenceUrl.FIREBASE_CHAT_URL); // Get app main firebase url
                authenticateUser.authWithPassword(userName, passWord, authResultHandler);

I have created a project in Firebase and added the JSON file in app module and added the compile com.google.firebase:firebase-core:9.8.0 library also please need help

1 Answer 1

2

Use below method authenticate firebase sign in:

FirebaseAuth.getInstance().signInWithEmailAndPassword(email,password).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                    if (task.isSuccessful()) {
                        //display some message here
                        Toast.makeText(Registration.this, "Successfully Signed In", Toast.LENGTH_LONG).show();
                    } else {
                        //display some message here
                        Toast.makeText(Registration.this, "Signed In Error", Toast.LENGTH_LONG).show();
                    }
                }
            });

Hope this will help you.

Sign up to request clarification or add additional context in comments.

2 Comments

Firebase authenticateUser = new Firebase(ReferenceUrl.FIREBASE_CHAT_URL); // Get app main firebase url authenticateUser.authWithPassword(userName, passWord, authResultHandler); this method
@KunalDudka After using the method given by Amrut Bidri you need to check auth state to check if user signed in or not. If user signed in correctly then authstate will change. check this: firebase.google.com/docs/auth/android/start. By the way I am seeing your authentication method first time, will you please point me a reference towards it in docs?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.