public virtual async Task <IActionResult> Logout(IdentityServerLogoutViewModel model) { await AccountService.SignOutAsync(); // set this so UI rendering sees an anonymous user HttpContext.User = new ClaimsPrincipal(new ClaimsIdentity()); // get context information (client name, post logout redirect URI and iframe for federated signout) var logoutModel = await IdentityServerIntegration.GetLogoutContextModelAsync(model.LogoutId); return(View("LoggedOut", logoutModel)); }
public virtual async Task <IActionResult> Logout(string logoutId) { var clientId = await IdentityServerIntegration.GetLogoutContextClientIdAsync(logoutId); if (!string.IsNullOrEmpty(clientId)) { // if the logout request is authenticated, it's safe to automatically sign-out return(await Logout(new IdentityServerLogoutViewModel { LogoutId = logoutId })); } var vm = new IdentityServerLogoutViewModel { LogoutId = logoutId }; return(View(vm)); }