swift - invalid_credentials error while firebase facebook authentication?
<p>I don't know what caused this problem, FB Login using Firebase was works perfectly. But now I encounter with <strong>INVALID_CREDENTIALS</strong> below error.</p>

<p>I tried deleting app from facebook and again run, and then checking <a href="https://developers.facebook.com/" rel="nofollow">https://developers.facebook.com/</a> every section but same problem still continue. </p>

<p>This error comes with <strong>print("yes (error)")</strong> line after printing <strong>accessToken</strong> perfectly.</p>

<p>I have searched, but I couldn't find possible solution, why this problem occur, how can I fix it?</p>

<p><strong>Error Domain=FirebaseAuthentication Code=-11 "(Error Code: INVALID_CREDENTIALS) Invalid authentication credentials provided." UserInfo={details={"providerErrorInfo":{}}, NSLocalizedDescription=(Error Code: INVALID_CREDENTIALS) Invalid authentication credentials provided.}</strong></p>

<pre><code>@IBAction func loginFb_clicked(sender: AnyObject) {

    let facebookLogin = FBSDKLoginManager()


    facebookLogin.logInWithReadPermissions(["email"], fromViewController: self) { (facebookResult: FBSDKLoginManagerLoginResult!, facebookError: NSError!) in

        if facebookError == nil {

            if FBSDKAccessToken.currentAccessToken() == nil {

                print("FOUND NIL!")

            }
            else if(facebookResult.isCancelled) {

                print("Cancelled")

            }
            else {

                let accessToken = FBSDKAccessToken.currentAccessToken().tokenString
                print(accessToken)

                DataService.ds.REF_BASE.authWithOAuthProvider("facebook", token: accessToken, withCompletionBlock: {
                    error, authData in

                    if error != nil {
                        print("yes \(error)")
                    }
                    else {

                        let dateFormatter = NSDateFormatter()
                        dateFormatter.dateFormat = "MMMM dd, yyyy hh:mm"
                        let stringDate = dateFormatter.stringFromDate(NSDate())
                        print("createdAt: " + stringDate)

                        let user =
                            ["id": authData.providerData["id"] as! String,
                                "accessToken": authData.providerData["accessToken"] as! String,
                                "provider": authData.provider!,
                                "displayName": authData.providerData["displayName"] as! String,
                                "email": authData.providerData["email"] as! String,
                                "profileImageURL": authData.providerData["profileImageURL"] as! String,
                                "token": authData.token as String,
                                "createdAt": stringDate]


                        let uuidString:String = authData.providerData["id"] as! String
                        DataService.ds.REF_USERS.childByAppendingPath("facebook:"+uuidString)
                            .observeSingleEventOfType(.Value, withBlock: { snapshot in
                                print("Solved snapshot is:")
                                print(snapshot.value)
                                if !snapshot.exists() {
                                    print("USER NOT EXIST ON DB!")

                                    // DataService.ds.REF_USERS_KEY.childByAppendingPath("facebook:"+uuidString).setValue("1")
                                    DataService.ds.createFirebaseUser(authData.uid, user: user)

                                }
                                else {
                                    print("USER EXIST ALREADY......................")
                                    DataService.ds.REF_USERS.childByAppendingPath("facebook:"+uuidString).updateChildValues(user)
                                }
                            })


                        print("Successfully logged in with facebook. \(accessToken)")
                        print("Logged in! \(authData)")

                        NSUserDefaults.standardUserDefaults().setValue(authData.uid, forKey: KEY_UID)
                        self.performSegueWithIdentifier(SEGUE_LOGGED_IN, sender: nil)
                    }
                })

            }
        }
    }
}
</code></pre>