title: Azure Active Directory Logout with ADAL library
body: <p>I used the my Azure Active Directory to protect my web API and I create a native application in the Azure management portal. This native application is basically a MVC web application and I use the ADAL library to get the token and call the api with that token. The code I used to get the token is shown below:</p>
  
  <pre><code>AuthenticationContext ac = new AuthenticationContext(authority);
  AuthenticationResult ar = ac.AcquireToken(resourceID, clientID, redirectURI);
  string accessToken = ar.AccessToken;
  </code></pre>
  
  <p>Now I need to logout and switch to another user but somehow the user credentials are remembered by the system. I clear the token cache in the authentication context and post logout api request as follows where *** is my tenant ID.</p>
  
  <pre><code>//Log out after api call
  ac.TokenCache.Clear();
  
  string requestUrl = "https://login.windows.net/***/oauth2/logout";
  
  var client = new HttpClient();
  var request = new HttpRequestMessage(HttpMethod.Get, requestUrl);
  var response = await client.SendAsync(request);
  </code></pre>
  
  <p>The api call succeeds but the logout doesn't work.
  What should I do to logout and switch to another user?</p>