简体   繁体   English

Facebook身份验证令牌无法创建Firebase身份验证

[英]Facebook auth token failing to create Firebase auth

I'm trying to sign into Firebase using this code to generate Firebase authentication credentials. 我正在尝试使用此代码登录Firebase以生成Firebase身份验证凭据。

func signIn(fromViewController controller: UIViewController) -> Promise<AuthCredential> {

        return wrap { completion in
            self.loginManager.logIn(withReadPermissions: ["public_profile"],
                                    from: controller,
                                    handler:completion)
            }
            .then { result -> AuthCredential in

                if result.isCancelled {
                    throw NSError.cancelledError()
                }

                let token = result.token!
                return FacebookAuthProvider.credential(withAccessToken:token.tokenString)
        }
    }

And getting this error back. 并返回此错误。

ERROR Error Domain=FIRAuthErrorDomain Code=17999 "An internal error has occurred, print and inspect the error details for more information." UserInfo={error_name=ERROR_INTERNAL_ERROR, NSLocalizedDescription=An internal error has occurred, print and inspect the error details for more information., NSUnderlyingError=0x6040001cb050 {Error Domain=FIRAuthInternalErrorDomain Code=3 "(null)" UserInfo={FIRAuthErrorUserInfoDeserializedResponseKey={
    code = 400;
    errors =     (
                {
            domain = global;
            message = "Unsuccessful debug_token response from Facebook: {\"error\":{\"message\":\"(#100) You must provide an app access token or a user access token that is an owner or developer of the app\",\"type\":\"OAuthException\",\"code\":100,\"fbtrace_id\":\"CCGlFkNF1pl\"}}";
            reason = invalid;
        }
    );
    message = "Unsuccessful debug_token response from Facebook: {\"error\":{\"message\":\"(#100) You must provide an app access token or a user access token that is an owner or developer of the app\",\"type\":\"OAuthException\",\"code\":100,\"fbtrace_id\":\"CCGlFkNF1pl\"}}";    
}}}}

I setup my app in the facebook developer area and cut and pasted the app id and secret key into the facebook auth setup in firebase. 我在Facebook开发人员区域中设置了我的应用程序,然后将应用程序ID和密钥粘贴并粘贴到了Firebase中的Facebook身份验证设置中。 So I'm quite stuck at the moment as to what I might have done wrong. 因此,对于目前可能做错的事情,我目前深感困惑。

Anyone encountered this problem? 有人遇到这个问题吗?

have you enabled Facebook on Firebase console ? 您是否在Firebase控制台上启用了Facebook?

In my advanced settings within the facebook app, I had turned on " Is App Secret embedded in the client ? " 在facebook应用程序的高级设置中,我打开了“ 客户端是否嵌入了应用程序秘密? ”。

Turning that off made it all work!!!! 关闭它使一切正常!!!

在此处输入图片说明

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM