Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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();
}