简体   繁体   English

使用Facebook令牌的Firebase Unity SDK身份验证

[英]Firebase Unity SDK Auth using Facebook Token

I am using the Firebase SDK for Unity. 我正在使用Firebase SDK for Unity。 I am trying to do Firebase auth using Facebook credentials but I am getting the below error on Android. 我正在尝试使用Facebook凭据进行Firebase身份验证,但在Android上出现以下错误。 Everything looks configured properly in the Firebase Console. 在Firebase控制台中,一切看上去都已正确配置。 I have enabled Facebook as a Sign-In-Method and added the OAuth redirect URL to my Facebook app configuration. 我已将Facebook作为登录方法启用,并将OAuth重定向URL添加到了我的Facebook应用程序配置中。 Thank you for any help. 感谢您的任何帮助。

 private void AuthFirebaseFacebook(string token) {
            Firebase.Auth.FirebaseAuth auth = Firebase.Auth.FirebaseAuth.DefaultInstance;
            Firebase.Auth.Credential credential =
            Firebase.Auth.FacebookAuthProvider.GetCredential(token);
            auth.SignInWithCredentialAsync(credential).ContinueWith(task => {
                if (task.IsCanceled)
                {
                    AtagDebug.Log("SignInWithCredentialAsync was canceled.");
                    return;
                }
                if (task.IsFaulted)
                {
                    AtagDebug.Log("SignInWithCredentialAsync encountered an error: " + task.Exception);
                    return;
                }

                Firebase.Auth.FirebaseUser newUser = task.Result;
                AtagDebug.Log("User signed in successfully: " +
                    newUser.DisplayName + " " + newUser.UserId);
            });
        }


SignInWithCredentialAsync encountered an error: 
System.AggregateException: Exception of type 'System.AggregateException' was thrown. 
Firebase.FirebaseException: An internal error has occurred. [ Access Not Configured. Google Identity Toolkit API has not been used in project 98824003602 before or it is disabled. Enable it by visiting https ]

The problem was I had an outdated google-services.json in one of my Android Plugins. 问题是我的一个Android插件中有一个过时的google-services.json。 Note to self and others: Be sure to update the google-services.json not only in Unity, but any plugins or external code you are using that gets built into the app. 自我和其他人的注意事项:确保不仅在Unity中更新google-services.json,而且还要更新应用程序中内置的所有正在使用的插件或外部代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无需使用facebook SDK即可获取facebook身份验证令牌 - Get a facebook auth token WITHOUT using the facebook SDK 使用PHP SDK将Facebook身份验证代码交换为访问令牌 - Exchanging Facebook Auth Code for Access Token using the PHP SDK Facebook统一访问令牌到firebase - facebook unity access token to firebase Facebook身份验证令牌无法创建Firebase身份验证 - Facebook auth token failing to create Firebase auth 在WebView中使用Facebook iOS SDK身份验证令牌 - Use facebook iOS SDK auth token in webview Facebook - SDK什么时候刷新身份验证令牌? - Facebook - when does the SDK refresh the auth token? 使用Firebase身份验证令牌使用JS SDK进行图形API调用 - Using firebase auth token to make graph api calls using JS SDK Android:成功登录后,如何使用Firebase Auth 9.6.1从Facebook获得令牌? - Android: How do I get the token from facebook using firebase Auth 9.6.1 after successful login? Facebook SDK-其余部分使用JS进行身份验证并使用PHP? - Facebook SDK - Using JS to Auth and PHP for the rest? 使用FSharp获取Facebook身份验证令牌 - Getting Facebook Auth Token Using FSharp
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM