Edit

Share via


Clearing the token cache

Clearing the token cache is achieved by removing the accounts from the cache. This does not remove the session cookie which is in the browser.

The example below is using an instance of IClientApplicationBase.

// Clear the cache
var accounts = await app.GetAccountsAsync();
while (accounts.Any())
{
   await app.RemoveAsync(accounts.First());
   accounts = await app.GetAccountsAsync();
}