Search code examples
iosswift3firebase-authenticationfbsdk

Firebase Facebook Login Error: FIRAuthErrorDomain - Unsuccessful debug_token response from Facebook


After implementing Facebook Login Auth with FBSDK, I've been trying to see/get a User in the Firebase Console's Auth tab.

I take the fb credentials and pass them to FIRAuth which has user and error arguments. After printing for visibility, the error is definitely occuring, but I'm struggling to inspect it. I tried with breakpoints and got something which looks like nonsense to me (I'm a beginner and started Swift 2 days ago and coding 2 months ago).

Code:enter image description here As you can see just above in the logs, print("error above") was executed.

Error:enter image description here On the left is the output from the breakpoint's analysis. It looks like nonsense to me and the people around me who have looked at it :(

Also you can see just above in the logs on the right, print("credential above") was executed. And the credential.description is immediately above it, a FIRFacebookAuthCredential object instance.

This makes me think the Facebook Auth has happened sucessfully, but the Firebase Auth is erroring.

Any ideas on where I might be going wrong are warmly welcomed. I'm new to Swift and Firebase totally.

Notes: I have all the FBSDK and Firebase dependencies installed and imported. I have done all the steps in Firebase docs including those on Facebook Dev API online interface which it references. So all the api settings I think I've covered.

Disclaimer: Here's the full code but be warned it's a bit disgusting.

Edit

I found more detailed error info which helped to debug, it was this

"Optional(Error Domain=FIRAuthErrorDomain Code=17999 \"An internal error has occurred, print and inspect the error details for more information.\" UserInfo={NSUnderlyingError=0x608000258c60 {Error Domain=FIRAuthInternalErrorDomain Code=3 \"(null)\" UserInfo={FIRAuthErrorUserInfoDeserializedResponseKey={\n code = 400;\n errors = (\n {\n domain = global;\n message = \"Unsuccessful debug_token response from Facebook: {\\\"error\\\":{\\\"message\\\":\\\"Invalid OAuth access token signature.\\\",\\\"type\\\":\\\"OAuthException\\\",\\\"code\\\":190,\\\"fbtrace_id\\\":\\\"FAA\\\\/****redacted****\\\”}}\”;\n reason = invalid;\n }\n );\n message = \"Unsuccessful debug_token response from Facebook: {\\\"error\\\":{\\\"message\\\":\\\"Invalid OAuth access token signature.\\\",\\\"type\\\":\\\"OAuthException\\\",\\\"code\\\":190,\\\"fbtrace_id\\\":\\\"FAA\\\\/***redacted***\\\”}}\”;\n}}}, error_name=ERROR_INTERNAL_ERROR, NSLocalizedDescription=An internal error has occurred, print and inspect the error details for more information.})"


Solution

  • I found that a human ignorance error had occurred at breakpoint self.mind - basically I had copied to clipboard ******'s instead of the actual data of my fb api key and had been using those stars inside Firebase Console Auth config.