With the old Firebase API everything was working fine but after I made changes according to the new API, I'm not able to google authenticate.
So Google authorization is working fine but when I'm trying to authenticate the same with Firebase it gives me this exception -
with no details.
I'm using this piece of code to google authenticate with Firebase.
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
if (result.isSuccess()) {
// Google Sign In was successful, authenticate with Firebase
GoogleSignInAccount account = result.getSignInAccount();
AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
mAuth.signInWithCredential(credential).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(!task.isSuccessful()){
//Control reaches here and prints the exception as stated above
Log.d(Constants.TAG, "onError:: Code : "+ task.getException().toString());
}
}
});
}
I also matched my code with the Firebase sample code for google authentication and everything is the same.
Please help.