title: iOS error with Firebase Auth Sign In using Twitter credentials
body: <p>I have a iOS Firebase app that supports Twitter login, but occasionally the <code>signIn(with: credential</code> call randomly fails and I can't figure out why.</p>
  
  <p>First the user signs in with Twitter (which never fails), then I use the Twitter session to get the credentials, and then I use those credentials to sign in with Firebase which sometimes fails. </p>
  
  <p>Here's the complete code </p>
  
  <pre><code>func twitterLogin(_ done:@escaping (_ user: FIRUser?, _ err: Error?) -&gt; Void) {
      Twitter.sharedInstance().logIn() { session, error in
          guard error == nil else {
              done(nil, error)
              return
          }
  
          let credential = FIRTwitterAuthProvider.credential(withToken: session!.authToken, secret: session!.authTokenSecret)
          FIRAuth.auth()?.signIn(with: credential, completion: { (signUser, error) in
              //User is signed in
  
              // ERROR OCCURS HERE. ANY HELP WOULD BE GREATLY APPRECIATED
  
              done(signUser, error)
          })
      }
  }
  </code></pre>
  
  <p>Here's the exact error message I'm getting. </p>
  
  <pre><code>UserInfo={NSUnderlyingError=0x600000442c10 {Error Domain=FIRAuthInternalErrorDomain Code=3 "(null)" UserInfo={FIRAuthErrorUserInfoDeserializedResponseKey={
  code = 400;
  errors =     (
              {
          domain = global;
          message = "Network error while to fetch VERIFY_CREDENTIAL from TWITTER.";
          reason = invalid;
      }
  );
  message = "Network error while to fetch VERIFY_CREDENTIAL from TWITTER.";
  }}}, error_name=ERROR_INTERNAL_ERROR, NSLocalizedDescription=An internal error has occurred, print and inspect the error details for more information.})
  </code></pre>
  
  <p>I've tried to specifically search for the error message I'm getting <strong>"Network error while to fetch VERIFY_CREDENTIAL from TWITTER."</strong> but I can't find any solution. I found some posts which I believe were in Japanese but I couldn't understand their solution. </p>
  
  <p>I even looked at Firebases iOS Auth errors here 
  <a href="https://firebase.google.com/docs/auth/ios/errors" rel="nofollow noreferrer">https://firebase.google.com/docs/auth/ios/errors</a>
  but the error key <strong>FIRAuthErrorUserInfoDeserializedResponseKey</strong> isn't even listed as a possible error for <code>signInWithCredential:completion:</code></p>