title: Facebook Authentication using Unity and Firebase: Credential malformed or expired
body: <p>I saw that a some people encountered this issue but none of the answers help me actually.</p>
  <p>So, I'm creating an app on unity (2020.1.11f1) and I'm using Firebase to deal with the authentication process. Email/Password authentication is working but now that I'm dealing with facebook authentication, I'm running into the famous error:</p>
  <blockquote>
  <p>Firebase.FirebaseException: The supplied auth credential is malformed or has expired</p>
  </blockquote>
  <p>I logged my app into facebook developper and connect it to firebase. I doubled check App ID and Secret ID.
  Also, my token is valid since I'm checking its validity. Also, it knows that it is coming from facebook.</p>
  <p>I'm using the piece of code (coming from official documentation):</p>
  <pre><code>private void facebook_loginFirebase(string accessToken)
          {
              //Get firebase authenticator and credential to perform connection
              Firebase.Auth.FirebaseAuth auth = Firebase.Auth.FirebaseAuth.DefaultInstance;
              Firebase.Auth.Credential credential = Firebase.Auth.FacebookAuthProvider.GetCredential(accessToken);
  
              //Perform Connection
              auth.SignInWithCredentialAsync(credential).ContinueWith(task =&gt; {
                  if (task.IsCanceled)
                  {
                      Debug.LogError(&quot;SignInWithCredentialAsync was canceled.&quot;);
                      popup_manager.openErrorPopup(&quot;5010&quot;, &quot;Task has been cancelled&quot;);
                      return;
                  }
                  if (task.IsFaulted)
                  {
                      Debug.LogError(&quot;SignInWithCredentialAsync encountered an error: &quot; + task.Exception);
                      popup_manager.openErrorPopup(&quot;5011&quot;, &quot;An error happened: &quot; + task.Exception);
                      return;
                  }
  
                  Firebase.Auth.FirebaseUser newUser = task.Result;
                  Debug.LogFormat(&quot;User signed in successfully: {0} ({1})&quot;,
                      newUser.DisplayName, newUser.UserId);
                  popup_manager.openInformationPopup(&quot;Account created with userID: &quot; + newUser.UserId);
  
              });
          }
  </code></pre>
  <p>Also, I'm using Facebook SDK 9.0. It seems it has changed a bit from previous versions and all tutorial on internet are based on old versions.
  Do you have any more tips to check?</p>
  <p>Thanks in advance! Let me know if I need to give you more information!</p>