title: Is there any way to delete the user from the firebase authentication?
body: <p>I am using Firebase Auth Rest API. I have code written in PHP to add the user to the database and firebase authentication. The information I store is kind, idToken, email, refreshToken, expiresIn, localId. It all works great!</p>
  
  <p>Now when I am trying to delete the user from database it works fine but does not delete the user from the firebase authentication. Please find the code below for sign up and deleting the user.</p>
  
  <p>The errors I get is either
  CREDENTIALS_TOO_OLD_LOGIN_AGAIN (or)
  INVALID_ID_TOKEN.</p>
  
  <p>FIREBASE_KEY is my firebase key and in the $data I am passing the user idToken</p>
  
  <pre><code>/*
  * User Sign Up
  */
  
  function user_signup($data){
      $response = true;
      $data = json_encode($data);
  
      $url = "https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=".FIREBASE_KEY;
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($ch, CURLOPT_POST, 1);
      curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
      curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
      $jsonResponse = curl_exec($ch);
      if(curl_errno($ch))
      {
          $response = false;
      }
      curl_close($ch);
      return $jsonResponse;
  }
  
  /*
  * User Delete
  */
  
  /* function user_delete($data){
      $response = true;
      $data = json_encode($data);
      $url = "https://www.googleapis.com/identitytoolkit/v3/relyingparty/deleteAccount?key=".FIREBASE_KEY;
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($ch, CURLOPT_POST, 1);
      curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
      curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
      $jsonResponse = curl_exec($ch);
  
      if(curl_errno($ch))
      {
          $response = false;
      }
      curl_close($ch);
  
      return $jsonResponse;
  
  } */
  </code></pre>