title: Logout is not clearing all process using oidc client with identity server 4
body: <p>We are using Office.context.ui.displayDialogAsync for authentication with OAUTH library (Oidc-client) and below are the findings. Kindly help on the same.</p>
  <ol>
  <li>As per attached code we were able to get access token in taskpane.ts file as args in messageHandler...</li>
  <li>But when i logged in fresh browser that time only Secure Token Service (STS) login window getting opening.</li>
  <li>If i logged out and cleared access token then again trying to logged in that time directly getting in as logged user without opening Secure Token Service (STS) window.</li>
  <li>Once i cleared browser cache and all then only i am able to get Secure Token Service (STS) window again... Can you please advise about the scenario to handle? Do we need anything.</li>
  </ol>
  <p><strong>Current Scenario</strong></p>
  <p>displayDialogAsync getting opened as STS login very first time and able to login successfully. But for the subsequent login it is not getting popup and directly loading the data with tokens.</p>
  <p><strong>Expected Scenario</strong></p>
  <p>displayDialogAsync  should not only open in first time login but also it should open for subsequent login which means if user logged out and trying to login again that time also it should popup.Is there anything need to clear cache for displayDialogAsync? Kindly help.</p>
  <p><strong>auth.ts</strong></p>
  <pre><code>Office.initialize = function () {
  
      var settings = {
        authority: &quot;https://xxxxxx.com/xxxx/xx&quot;,      
        client_id: &quot;https://xxxxxxx.com/&quot;,
        redirect_uri: &quot;https://localhost:3000/taskpane.html&quot;,
        // silent_redirect_uri:&quot;https://localhost:3000/taskpane.html&quot;, 
        post_logout_redirect_uri: &quot;https://xxxxxxx.com/&quot;,       
        response_type: &quot;id_token token&quot;,
        scope: &quot;openid read:xxxx read:xxxxxx read:xxxxxxx&quot;,
        state: true,
        clearHashAfterLogin: false,
        filterProtocolClaims: true,  
        loadUserInfo: true,
        nonce:true,       
      };
      Oidc.Log.logger = console;
      var mgr = new Oidc.UserManager(settings); 
      mgr.signinRedirect();
      mgr.signinRedirectCallback().then((user) =&gt; {       
        if (user) {
          console.log(user);
  
        } else {
          mgr.signinPopupCallback().then(function (user) {
            window.location.href = '../';
          }).catch(function (err) {
            console.log(err);
          });
          throw new Error('user is not logged in');
        }
      });    
    };
  </code></pre>
  <p><strong>taskpane.ts</strong></p>
  <pre><code>const loginpopup = function () {
        if (OfficeHelpers.Authenticator.isAuthDialog())
          return;     
        Office.context.ui.displayDialogAsync(
          url,
          { height: 60, width: 60, /*displayInIframe:true*/ },
          dialogCallback);
        function dialogCallback(asyncResult) {
          if (asyncResult.status == &quot;failed&quot;) {
           
            switch (asyncResult.error.code) {
              case 12004:
                console.log(&quot;Domain is not trusted&quot;);
                break;
              case 12005:
                console.log(&quot;HTTPS is required&quot;);
                break;
              case 12007:
                console.log(&quot;A dialog is already opened.&quot;);
                break;
              default:
                console.log(asyncResult.error.message);
                break;
            }
          }
          else {
            dialog = asyncResult.value; 
            dialog.addEventHandler(Office.EventType.DialogMessageReceived, messageHandler);
          }
        }
        function messageHandler(arg: any) {
          if (arg != &quot;jsonMessage&quot;) {
            $(&quot;.loader&quot;).show();
            var test = JSON.parse(arg.message).value.split(&quot;#&quot;)[1].split(&quot;&amp;&quot;)[1].split(&quot;=&quot;);         
            dialog.close();
          };
        }
  }
  </code></pre>
  <p><strong>logout.ts</strong></p>
  <pre><code>Office.initialize = () =&gt; {
  
    var settings = {    
      authority: &quot;https://xxxxxx.com/xxxxxx/v1&quot;,     
      client_id: &quot;https://xxxxxxx.com/&quot;,
      redirect_uri: &quot;https://localhost:3000/logout.html&quot;,    
      post_logout_redirect_uri: &quot;https://localhost:3000/logout.html&quot;, 
      metadata: {        
        issuer: 'https://xxxxxx.com/xxxxxx/v1',  
        authorization_endpoint:  &quot;https://xxxxxx.com/xxxxxxx/v1/xxxxx&quot;      
    }    
    };  
    var mgr = new Oidc.UserManager(settings);   
    mgr.signoutRedirect();
    mgr.removeUser();
    mgr.revokeAccessToken();
    mgr.clearStaleState();
    $(&quot;document&quot;).ready(function () {    
    localStorage.removeItem('accessToken');  
    localStorage.clear();
    });  
  </code></pre>