在MVC 5应用程序上注销,使用IdentityServer进行cookie身份验证

问题描述 投票:0回答:1

我有一个针对IdentityServer4进行身份验证的MVC 5 Web应用程序。我使用cookie身份验证和openID连接。如何实现注销?

asp.net-mvc-5 identityserver4 openid-connect logout
1个回答
0
投票

您可以通过简单地添加以下注销操作来实现注销:

namespace Net4MvcClient.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Logout()
        {
            System.Web.HttpContext.Current.GetOwinContext().Authentication.SignOut();
            return Redirect("/");
        }
    }
}

阅读更多here

© www.soinside.com 2019 - 2024. All rights reserved.