title: Is the firebase access token refreshed automatically?
body: <p>I'm using the Firebase email/password authentication.
  After the user has signed in successfully I query the access token the following way:</p>
  
  <pre><code>FirebaseUser mUser = FirebaseAuth.getInstance().getCurrentUser();
  mUser.getIdToken(true)
      .addOnCompleteListener(new OnCompleteListener&lt;GetTokenResult&gt;() {
      public void onComplete(@NonNull Task&lt;GetTokenResult&gt; task) {
          if (task.isSuccessful()) {
              String idToken = task.getResult().getToken();
              // Send token to your backend via HTTPS
              // ...
          } else {
              // Handle error -&gt; task.getException();
          }
      }
  });
  </code></pre>
  
  <p>According to the Firebase documentation the access token expires after 1 hour. To handle the case to have always the current access token in my app, I was looking for a solution and I found in the firebase documentation that I have <a href="https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseAuth.IdTokenListener" rel="noreferrer">to register a Firebase.IdTokenListener</a> to listen to the </p>
  
  <blockquote>
    <p>onIdTokenChanged event</p>
  </blockquote>
  
  <p><strong>My question is</strong>: Is the </p>
  
  <blockquote>
    <p>onIdTokenChanged event</p>
  </blockquote>
  
  <p>automatically fired if the access token expired?</p>
  
  <p>In case the event is not automatically fired after the access token has expired, what would be the coorect approach to query "manually" for a new/updated Access token with the</p>
  
  <pre><code>"FirebaseAuth.getInstance().getCurrentUser().getIdToken(boolean)"
  </code></pre>
  
  <p>method?</p>
  
  <p>I know, that If I call the</p>
  
  <blockquote>
    <p>mUser.getToken(true)</p>
  </blockquote>
  
  <p>then the mentioned event is fired and the </p>
  
  <blockquote>
    <p>IdTokenListener</p>
  </blockquote>
  
  <p>is triggered. But this is not what I'm looking.</p>