title: Firebase Token Refresh on Firebase Cloud Function
body: <p>We have an app then a Cloud Function as well that serves HTTP request. To secure and target the user data, we used the token generated from client/app then use it as a query parameter to HTTP request.</p>
  <p>Client/App (Java)</p>
  <pre><code>firebaseUser.getIdToken(true).addOnSuccessListener(getTokenResult -&gt; //HTTP here with Volley where getTokenResult.getToken() is one of the query parameters.
  </code></pre>
  <p>Server/Cloud Function</p>
  <pre><code>// idToken comes from the client app
          return admin.auth().verifyIdToken(req.query.idToken)
              .then(function (decodedToken) {
  
                  var uid = decodedToken.uid;
                  console.log(&quot;User verified: &quot; + uid);
  </code></pre>
  <p>Everything works fine but as I recall token have expiration maybe after an hour, so my question is how can we manage token refresh once it gets expired on Cloud Function side since we do not want to repeatedly refresh it in client side?</p>