Exemplo n.º 1
0
        private async Task <IActionResult> Logout(LogoutInputModel inputModel)
        {
            var model = await GetExternalLogoutModel(inputModel.LogoutId);

            if (model != null)
            {
                // build a return URL so the upstream provider will redirect back
                // to us after the user has logged out. this allows us to then
                // complete our single sign-out processing.
                var url = Url.Page("/Account/Logout", new { logoutId = model.LogoutId });

                // this triggers a redirect to the external provider for sign-out
                return(SignOut(new AuthenticationProperties {
                    RedirectUri = url
                }, model.Scheme));
            }

            return(RedirectToPage("/Account/SignedOut", new { inputModel.LogoutId }));
        }
Exemplo n.º 2
0
 public async Task <IActionResult> OnPostAsync(LogoutInputModel model)
 {
     return(await Logout(model));
 }