title: How to test refresh and expired token scenarios?
body: <p>I'm using the <code>msal.js</code> library for authentication against my AAD account. I've got the logic to handle refreshing of tokens implemented, but I'm not sure how best to manually test this.</p>
  
  <pre class="lang-js prettyprint-override"><code>    try {
        const response = await userAgentApplication.acquireTokenSilent(parameters);
        jwtIdToken = response.idToken.rawIdToken;
      } catch (error) {
        if (error instanceof InteractionRequiredAuthError) {
          if (type === LoginType.Redirect) {
            userAgentApplication.acquireTokenRedirect(parameters);
          }
  
          const response = await userAgentApplication.acquireTokenPopup(parameters);
          jwtIdToken = response.idToken.rawIdToken;
        } else {
          // Error was not related to needing interaction
          throw error;
        }
      }
  </code></pre>
  
  <p>I'm able to verify that the token is being refreshed correctly using the <code>system</code> config and setting a token renewal offset to a value larger than the expiration limit.</p>
  
  <pre><code>  system: {
      tokenRenewalOffsetSeconds: 60 * 60
    }
  </code></pre>
  
  <p>The only scenario I don't know how to test is when the token can no longer be refreshed, and the user needs to login again after the <code>InteractionRequiredAuthError</code> error is thrown. I'm really hoping I don't have to keep a session active for 24 hours then try to refresh the token...</p>