Attempting to register a new user using Google Auth throws the error "The supplied auth credential is malformed or has expired. [ Unable to parse Google id_token: "
Code successfully generates the idToken and accessToken.
Firebase Authentication works fine with Facebook and manual registration via email and password.
Can't figure out what is going wrong.
Any help would be greatly appreciated, if you need any more information just let me know.
//sign in with google
Future signInWithGoogle() async {
try {
final GoogleSignInAccount googleUser = await _googleSignIn.signIn();
final GoogleSignInAuthentication googleAuth = await googleUser.authentication;
final AuthCredential credential = GoogleAuthProvider.getCredential(
idToken: googleAuth.accessToken,
accessToken: googleAuth.idToken
);
print(credential);
final FirebaseUser user = (await _auth.signInWithCredential(credential)).user;
print('signed in' + user.displayName);
return _userFromFirebaseUser(user);
} catch (e) {
print(e.message);
return null;
}
}