title: How to protect firebase Cloud Function HTTP endpoint using authenticated id token and database rules?
body: <pre><code>admin.auth().verifyIdToken(tokenId)
        .then((decoded) =&gt; res.status(200).send(decoded))
  </code></pre>
  
  <p>I understand <code>verifyIdToken()</code> can verify a user id token from Firebase Authentication clients. However we need to protect our Cloud Function by making sure database queries are limited by the security rules defined for the database for the user identified in the token.  Given that the admin SDK has unlimited access by default, how to I limit its access to just that of the authenticated user?</p>