Exemplo n.º 1
0
        public async Task <IActionResult> Logout(LogoutModel model)
        {
            // delete local authentication cookie
            await HttpContext.Authentication.SignOutAsync();

            var context = await _interaction.GetLogoutContextAsync(model.LogoutId);

            return(View("LoggedOut", new LoggedOutModel
            {
                ClientName = context?.ClientId,
                PostLogoutRedirectUri = context?.PostLogoutRedirectUri,
                SignOutIframeUrl = context?.SignOutIFrameUrl,
                AutomaticRedirectAfterSignOut = true
            }));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Logout(string logoutId)
        {
            var model = new LogoutModel {
                LogoutId = logoutId
            };

            var context = await _interaction.GetLogoutContextAsync(logoutId);

            if (!context.ShowSignoutPrompt)
            {
                // no need to show prompt
                return(await Logout(model));
            }

            return(View(model));
        }