Unity with Firebase + Google Authentication How-to

Asked

Viewed 61 times

0

I’m in need of a help to use Firebase with Google Authentication in the documentation this very vague for me at least.

example is this code where I get these googleIdToken and the googleAcessToken? I can’t find it anywhere:

Firebase.Auth.Credential credential =
Firebase.Auth.GoogleAuthProvider.GetCredential(googleIdToken, googleAccessToken);
    auth.SignInWithCredentialAsync(credential).ContinueWith(task => {
        if (task.IsCanceled)
        {
            Debug.LogError("SignInWithCredentialAsync was canceled.");
            return;
        }
        if (task.IsFaulted)
        {
            Debug.LogError("SignInWithCredentialAsync encountered an error: " + task.Exception);
            return;
        }

        Firebase.Auth.FirebaseUser newUser = task.Result;
        Debug.LogFormat("User signed in successfully: {0} ({1})",
            newUser.DisplayName, newUser.UserId);
        SceneManager.LoadScene("checkNework");

    });
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.