title: How to check if current password is valid in firease admin sdk?
body: <p>I have a firebase powered app. The requirement is to <strong>update the account password</strong> by typing the <code>currentPassword</code> and the <code>newPassword</code>.</p>
  
  <p>On the server (firebase cloud function + admin sdk) i need to check if the provided <code>currentPassword</code> is valid.</p>
  
  <p>When an account is created for the first time, <strong>firebase automatically encrypts the password</strong>, and gives me back only the hash.</p>
  
  <p>The problem is - <strong>this encryption is done automatically, under the covers</strong>. </p>
  
  <p>Without having access to the encryption method, i can't obtain the hash of the <code>currentPassword</code> in order to compare it to the stored hash of the real password.. to see if this 2 hashes match.</p>
  
  <p>So how can i check if the <code>currentPassword</code> is valid? How to get access to the same method firebase-auth uses for encryption?</p>
  
  <p>I coudn't find anything relevant so far. am I using the wrong approach here? Why is it so hard to find it ?</p>