Facebook登录错误在Android上使用Firebase:不成功的debug_token响应

时间:2017-10-28 12:50:04

标签: android firebase firebase-authentication facebook-login facebook-android-sdk

我已经将Facebook作为firebase控制台中的提供商之一,并且已经双重检查了Facebook app_id,app在firebase和facebook中的秘密匹配。此外,firebase Oauth重定向URI是我的Facebook应用设置中唯一有效的oauth重定向URI。

在运行Facebook登录流程时,我多次验证登录流程是否成功,并且我正在从Facebook正确获取Oauth令牌。但是,mAuth.signInWithCredential(credential)对象的Task<AuthResult>代码失败,并出现以下异常

10-28 18:01:02.471 3883-3883/com.my.android.app D/ray232: signInWithCredential:failure
com.google.firebase.FirebaseException: An internal error has occurred. [ Unsuccessful debug_token response from Facebook:{&quot;error&quot; ]
                                                           at com.google.android.gms.internal.zzdlj.zzak(Unknown Source)
                                                           at com.google.android.gms.internal.zzdkl.zza(Unknown Source)
                                                           at com.google.android.gms.internal.zzdlu.zzal(Unknown Source)
                                                           at com.google.android.gms.internal.zzdlw.onFailure(Unknown Source)
                                                           at com.google.android.gms.internal.zzdll.onTransact(Unknown Source)
                                                           at android.os.Binder.execTransact(Binder.java:446)

这是抛出异常的代码片段:

mAuth.signInWithCredential(credential).addOnCompleteListener(launchActivity, new OnCompleteListener<AuthResult>() {
        @Override
        public void onComplete(@NonNull Task<AuthResult> task) {
            if (task.isSuccessful()) {
                Log.d("ray232", "signInWithCredential:success");
                launchActivity.onLoginRequired(false);
            } else {
                Log.d("ray232", "signInWithCredential:failure", task.getException());
                Toast.makeText(launchActivity, "Authentication failed.",
                        Toast.LENGTH_SHORT).show();
                launchActivity.onLoginRequired(true);
            }
        }
    });

关于这个问题的问题Unsuccessful debug token response有一个相同的问题,但我已经尝试了答案中建议的所有内容,但无济于事。

我使用以下版本:

com.firebaseui:firebase-ui-auth:3.1.0
com.google.android.gms:play-services:11.4.2
com.google.firebase:firebase-auth:11.4.2
com.google.firebase:firebase-core:11.4.2
com.facebook.android:facebook-login:4.27.0

1 个答案:

答案 0 :(得分:-3)

addOnCompleteListener的第一个参数上,尝试使用launchActivity.this