title: How to Logout of Owin Providers?
body: <p>I am following <a href="https://dzone.com/articles/using-owin-external-login">this tutorial</a> yet it does not tell you how to logout. I tried to do </p>
  
  <pre><code>Request.GetOwinContext().Authentication.SignOut(Microsoft.AspNet.Identity.DefaultAuthenticationTypes.ExternalCookie);
  
  Request.GetOwinContext().Authentication.SignOut()
  
            Request.GetOwinContext().Authentication.SignOut(Microsoft.AspNet.Identity.DefaultAuthenticationTypes.ApplicationCookie);
  </code></pre>
  
  <p>You can get the sample code here: <a href="https://github.com/AndersAbel/SocialLoginWithoutIdentity">https://github.com/AndersAbel/SocialLoginWithoutIdentity</a></p>
  
  <p>Just need to add one more action</p>
  
  <pre><code>public ActionResult SignOut()
   {
         Request.GetOwinContext().Authentication.SignOut(Microsoft.AspNet.Identity.DefaultAuthenticationTypes.ExternalCookie);
         return RedirectToAction("Index", "Home");
   }
  </code></pre>
  
  <p>This method plus any one of the 3 lines of I posted above </p>
  
  <p>My result right now is, I login, I go to secure page and can see it, I then proceed to my signout and then after signout try to go back to the secure page and I am allowed back to that secure page.</p>
  
  <p>So it actually did not really sign me out.</p>