firebase-ios-sdk: 'data parameter is nil' when parsing FIRUser IDToken on 4.13.0 while signing into facebook

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 9.3_
  • Firebase SDK version: 4.13.0___
  • Firebase Component: _Auth (Auth, Core, Database, Firestore, Messaging, Storage, etc)
  • Component version: 4.6.1_

[REQUIRED] Step 2: Describe the problem

My current IOS project has two targets (“production” and “development”). In the production version of the project, I can sign in using facebook without a crash. Yet when signing into Facebook on the development target the app crashes with a “Thread 82: EXC_BREAKPOINT” break point inside - (void)invokeFetchCallbacksOnCallbackQueueWithData: function. Also all other sign methods work (email/password and google) on both targets. screen shot 2018-04-18 at 9 15 16 pm

screen shot 2018-04-18 at 9 17 14 pm

podfile.lock screen shot 2018-04-18 at 9 20 30 pm screen shot 2018-04-18 at 9 21 25 pm

If you like to see the pod file itself i can also add that too. Yet i did not change that file before updating pods, i just ran pod update in terminal. Before the update everything worked as intended on both targets.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 37 (12 by maintainers)

Most upvoted comments

Hi all,

I have an update; the staging-4.13.1 branch now contains a fix which should address token parsing error mentioned at the beginning of this thread. Please feel free to use this branch to verify that the parsing error is fixed for your affected users.

-Z

As #1072 was closed, I’ll post here which seems to be the new Issue related to the -[FIRUser parseIDToken:error:] crash.

There is still a regression with -[FIRUser parseIDToken:error:] .

We upgraded from 4.11 to 4.12 in our previous release and went from 94.38% crash free users to 51.19%

Then we released a hotfix version including 4.13 and still get some -[FIRUser parseIDToken:error:] crashes. We have 85.15% crash-free users, number going down.

#0 Crashed: com.google.firebase.auth.serialTaskQueue
EXC_BREAKPOINT 0x00000001002b3418
capture d ecran 2018-04-20 a 15 33 46

@paulb777 it does seem to be a podspec issue with RNFirebase. I was able to fix that problem using a suggested fix in an open PR on their repo, see here: https://github.com/invertase/react-native-firebase/pull/1017

tl;dr, this repo is not the cause of that issue.

Thanks for the help!

The fix will deploy in our upcoming 5.0.0 release.

In the meantime to access the workaround, make sure you run pod update with a Podfile including:

pod 'FirebaseCore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'staging-4.13.1'
pod 'FirebaseAuth', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'staging-4.13.1'

If you’re having trouble setting up the workaround, please share the Podfile you’re using.

@stshelton yeah, it’s a little picky, here is what i’m using

pod 'FirebaseCore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'master'
  pod 'FirebaseAuth', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'master'
  pod 'FirebaseMessaging', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'master'
  pod 'Firebase/DynamicLinks'
  pod 'Firebase/Performance'

@iiAtlas You’re running into the static library (no use_frameworks!) issue documented with workaround here. The static library source pods issue is also fixed in 5.0.0.

Sorry, we can’t give out dates - but you could investigate when the last two major Firebase releases came out to make a guess …

@klwoon This is expected behavior. The parser is able to handle the “invalid URL” now (I can provide a detailed explanation as to why the token parsing failed and why the URL is not invalid, if needed).

I think you should still handle the above mentioned error case since there may be some exceptional edge case where token parsing fails; in which case you can obtain your JWT regardless.

-Z

Thanks for the quick response to fix the issue.

Last week (19 April 2018) I was using the master branch with this commit:

https://github.com/firebase/firebase-ios-sdk/commits/81ac1761e2195aa2f16c0377471e084910ccdb35

And Firebase will return the following error for invalid token after signing in with Facebook:

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=0x1d4249600 {Error Domain=FIRAuthInternalErrorDomain Code=4 "(null)" UserInfo={FIRAuthErrorUserInfoDeserializedResponseKey= [MY JWT TOKEN]}}}

And today (23 April 2018) after switching to the ‘staging-4.13.1’ branch, Firebase no longer return the error above even with the same sign-in that contains invalid URL, is this the expected behaviour?

Thank you.

I’m using react-native-firebase which subsequently uses the iOS SDK. We’re experiencing the same problem when we call Firebase.auth().currentUser.getIdToken().

We’re using iOS SDK version 4.13.0. This problem only started happening after updating from a previous version of the iOS SDK. We have also found that the version of react-native-firebase we use makes no difference.

These are the Firebase pods in our Podfile

  pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios/RNFirebase.podspec'
  pod 'Firebase/Core'
  pod 'Firebase/AdMob'
  pod 'Firebase/Analytics'
  pod 'Firebase/Auth'
  pod 'Firebase/Database'
  #pod 'Firebase/DynamicLinks'
  #pod 'Firebase/Firestore'
  #pod 'Firebase/Messaging'
  pod 'Firebase/Performance'
  pod 'Firebase/RemoteConfig'
  pod 'Firebase/Storage'
  pod 'Fabric', '~> 1.7.2'
  pod 'Crashlytics', '~> 3.9.3'

Thanks @stshelton and @rromanchuk. I was just coming here to add this and y’all beat me to it. I’m having the exact same issue.