Firebase 身份验证错误代码 5
Firebase authentication error code 5
我正在尝试使用 google 登录来登录 firebase。 google 登录成功。在此之后,我调用 authWithOAuthToken 并且出现以下错误。
Due to another authentication attempt, this authentication attempt was aborted before it could complete. Error Code = -5
其他几个问题:
- 我们是否需要调用 authWithOAuthToken(google 登录后)?我注意到即使没有调用我也可以将数据添加到 firebase 数据库。
- 如果不需要上述内容,我如何获取 uid(即跨提供商的 firebase 用户 ID 相同)。目前我们可以从 AuthData 中得到这个。
下面的代码片段。
baseFirebaseRef.authWithOAuthToken("google", oAuthTokenStr, new Firebase.AuthResultHandler() {
// @Override
public void onAuthenticated(AuthData authData) {
// the Google user is now authenticated with your Firebase app
Log.d(currentScreenName, "------On Firebase Authentication. Success");
}
// @Override
public void onAuthenticationError(FirebaseError firebaseError) {
// there was an error
Log.e(currentScreenName, "------Error On Firebase Authentication......." + firebaseError.getDetails() +
"Error Message = "+ firebaseError.getMessage() + " Error Code = "+ firebaseError.getCode()) ;
}
});
我调用了 unauth(),然后调用了 authWithOAuthToken()。
我正在尝试使用 google 登录来登录 firebase。 google 登录成功。在此之后,我调用 authWithOAuthToken 并且出现以下错误。
Due to another authentication attempt, this authentication attempt was aborted before it could complete. Error Code = -5
其他几个问题:
- 我们是否需要调用 authWithOAuthToken(google 登录后)?我注意到即使没有调用我也可以将数据添加到 firebase 数据库。
- 如果不需要上述内容,我如何获取 uid(即跨提供商的 firebase 用户 ID 相同)。目前我们可以从 AuthData 中得到这个。
下面的代码片段。
baseFirebaseRef.authWithOAuthToken("google", oAuthTokenStr, new Firebase.AuthResultHandler() {
// @Override
public void onAuthenticated(AuthData authData) {
// the Google user is now authenticated with your Firebase app
Log.d(currentScreenName, "------On Firebase Authentication. Success");
}
// @Override
public void onAuthenticationError(FirebaseError firebaseError) {
// there was an error
Log.e(currentScreenName, "------Error On Firebase Authentication......." + firebaseError.getDetails() +
"Error Message = "+ firebaseError.getMessage() + " Error Code = "+ firebaseError.getCode()) ;
}
});
我调用了 unauth(),然后调用了 authWithOAuthToken()。