protected internal virtual async Task <SignOutViewModel> CreateSignOutViewModelAsync(string signOutId) { var model = new SignOutViewModel { Confirm = this.Facade.IdentityServer.CurrentValue.Account.ConfirmSignOut, Form = { Id = signOutId } }; if (this.User.Identity.IsAuthenticated) { var signOutRequest = await this.Facade.Interaction.GetLogoutContextAsync(signOutId); if (signOutRequest != null && !signOutRequest.ShowSignoutPrompt) { model.Confirm = false; } } else { model.Confirm = false; } return(model); }
protected async override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); this.viewModel = this.DataContext as SignOutViewModel; await this.viewModel.LoadSignOutList(e.Parameter as string); }
public async Task <IActionResult> SignOut([FromBody] SignOutViewModel signOutViewModel) { try { await _tokenProvider.DeleteRefreshTokenById(signOutViewModel.RefreshToken); await _tokenProvider.DeleteAccessToken(signOutViewModel.AccessTokenSignature); } catch (Exception) { return(new StatusCodeResult((int)HttpStatusCode.InternalServerError)); } return(new OkResult()); }
private async Task <SignOutViewModel> BuildSignOutViewModelAsync(string signOutId) { var model = new SignOutViewModel { SignOutId = signOutId, ShowSignOutPrompt = AccountOptions.ShowSignOutPrompt }; if (User?.Identity.IsAuthenticated != true) { model.ShowSignOutPrompt = false; return(model); } var context = await _interactionService.GetLogoutContextAsync(signOutId); if (context?.ShowSignoutPrompt == false) { model.ShowSignOutPrompt = false; return(model); } return(model); }
public ActionResult SignOut() { ViewBag.Message = "Sair"; var viewModel = new SignOutViewModel(); var manager = HttpContext.GetOwinContext().GetUserManager <ApplicationUserManager>(); if (manager == null) { return(View(viewModel)); } var user = manager.FindById(User.Identity.GetUserId()); if (user == null) { return(View(viewModel)); } viewModel.Clients = user.Clients; return(View(viewModel)); }