New Firebase API not logging in for my Twitter users

My application previously checked users, and then I implemented a new twitter code:

vc.twitterLogin = { session, error in if let session = session { let credential = FIRTwitterAuthProvider.credentialWithToken(session.authToken, secret: session.authTokenSecret) FIRAuth.auth()?.signInWithCredential(credential) { [unowned self] user, error in if let error = error { print(error.userInfo["NSUnderlyingError"]) } if user != nil { self.navCtrl.popViewControllerAnimated(true) self.delegate?.didAuthenticate(self) } } } } 

Twitter authentication works fine, as you can see that it is executing a FIRAuth block. Any ideas?

Here is the error:

Optional (Error Domain = FIRAuthInternalErrorDomain Code = 3 "(null)" UserInfo = {FIRAuthErrorUserInfoDeserializedResponseKey = {type = immutable dict, count = 3, entries => 0: {content = "message"} = {contents = "Failed to get successful verify_credentials response from Twitter: {"errors": [{"code": 32, "message": "Failed to authenticate you."}}} "} 1: errors = {type = immutable, count = 1, values = (0: {type = immutable dict, count = 3, entries => 0: reason = invalid 1: message = {contents = "Failed to get a verify verify_credentials response from Twitter: {" errors ": [{" code ": 32, "message": "Failed to authenticate you."}}} "} 2: domain = global}

)} 2: code = {value = +400, type = kCFNumberSInt64Type}}})

+8
firebase firebase-authentication
source share
1 answer

You need to update the Firebase Twitter API keys in the new interface (Auth β†’ Sign In Method β†’ ​​Twitter) for the Fabric.io you automatically generate. They are available in the Fabric.IO interface.

I assume that you have enabled Fabric.IO to automatically generate new keys for you against the Twitter API and use them in a new custom Fabric.IO entry in your Info.plist, but have not changed them to Firebase yet. Updating these entries fixed the issue for me.

+15
source share

All Articles