Example #1
0
        protected override Task HandleSignOutAsync(AuthenticationProperties properties)
        {
            AuthenticationLogMessages.SignOutHandling(Logger);

            Response.Cookies.Delete(Options.TokenHeaderAndPayloadCookieKey);
            AuthenticationLogMessages.AuthenticationTokenHeaderAndPayloadDetached(Logger, Options.TokenSignatureCookieKey);
            Response.Cookies.Delete(Options.TokenSignatureCookieKey);
            AuthenticationLogMessages.AuthenticationTokenSignatureDetached(Logger, Options.TokenSignatureCookieKey);

            if (properties.RedirectUri is string)
            {
                AuthenticationLogMessages.IssuingSignOutRedirect(Logger, properties.RedirectUri);
                Response.Redirect(properties.RedirectUri);
            }

            AuthenticationLogMessages.SignOutHandled(Logger);
            return(Task.CompletedTask);
        }